9

I'm wondering how to display the current Rails version in a view. I already know that this will print the current Ruby version:

<%= RUBY_VERSION %>

But I'm not sure how to do this for Rails.

Edit: I tried to use <%= debug(request.env) %> to list all environment variables; unfortunately the Rails version isn't one of them.

1 Answer 1

16

You can just do :

<%= Rails.version %>
1
  • Wow, that was easy! I should have figured that out.
    – hao_maike
    Commented Dec 30, 2011 at 17:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.