rails pass instance variable to layout or local variable -


I have a navigation bar (actually two) and I have some controllers to implement it in a dynamic data (second Times can not exist in some), I have seen so many complaints that many footage scenes are not seen, and they have been suggested to render them to local people. I am thinking of using an example variable to generate these things in the main layout, whether or not it is a good idea, and if it is not, how should I do this, render to overwrite the default view And I use the data in the main layout only

I'm not sure that I have a good question Understand the way But for some of my menus I use something like this in my layout:

  <% = yield (: menu_top)%>   

And I use

  content_for: menu_top   

to generate content in this area.

For example:

  For & lt;% = content_: menu_opt% & gt; & Lt; Li & gt; My special content or var & lt; / Li & gt; & Lt;% end% & gt;   

Here is the guide to the content:

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -