ruby on rails 3 - Listing a model in a drop down menu its submenu -
i have model named portfolio. list portfolios created on page in drop down menu this:
<ul> <% @portfolios.each |portfolio| %> <li style="z-index: 2;"><%= link_to portfolio.name, portfolio_path(portfolio) %></li> <% end %> </ul>
i have 3 portfolios in drop down menu: advertising, graphic design, web development. have menu item called photography opens sub-menu of portrait, landscape, , editorial. advertising, graphic design, web development, portrait, landscape, editorial models of portfolio. photography there facilitate sub-menu portrait, landscape, , editorial. i'm not sure how set up. should create new model named photography_portfolio? , how create photography menu item if it's not portfolio?
what storing in portfolio model? hard code menu. depending on use case hard code top level menu items , pull in different portfolios
in drop down menu, could, example, create different scopes different types.
Comments
Post a Comment