ruby on rails - obtain :title field in controller -


I want to store page titles in some place for later use. I used Nifty-Generator to generate layout

How to use the value, which was determined according to the title () method? Do I have to hold it in the controller? Is it stored in a reaction somewhere?

Or do I need to move the title setting to the controller's action, because I wonder what do I have to do with the MVC nature?

If you want to use any of the variables in more than one request, keep it in the controller needed. There are several ways to do this:

  1. You can pass this variable in the URL.
  2. Put it in session
  3. Keep cookies in it
  4. You can also use Flash in Rails.

Comments