Monday, April 23, 2012

Creating Partial view with Menu items populated from Model (Rails)

I am trying to use partial views to create Menu items which are driven from database.
I searched the web and found the below



 - Partial view files should have "_" at beginning of its name (_menu.html.erb)
- Partial views are called using <%= render "menu" %>


but in my application, i should load menu items which are taken from a db table and load it in a layout file (I could use models for interacting with db)
how do i achieve getting the model result in layout file? any reference would be helpful...!!



Thanks in advance.





No comments:

Post a Comment