Rails 3 - Ideal way to set title of pages
- by akfalcon
Whats the proper way to set the page title in rails 3. Currently I'm doing the following:
app/views/layouts/application.html
....
<%= render_title %
<%= csrf_meta_tag %
....
app/helpers/application_helper.rb
...
def render_title
return @title if defined?(@title)
"Generic Page Title"
end
...
app/controllers/some_controller.rb
...
def show
@title = "some custom page title"
...
end
...
Is there another/better way of doing the above?