ruby on rails - Page title variable, can I fetch from file also? -
in main layout page, have this:
<title> title_from_config || @page_title </title>
basically if page_title variable wasn't set, use default page title.
i want default page title config file or something, suggest use this?
this rails 3.
you can add initializer file (config/initializers/constants.rb) contains config options application. make sure use ruby constants here they're available in top-level namespace of application.
Comments
Post a Comment