Not signed in (Sign In)
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorriffed
    • CommentTimeMar 6th 2008
     

    I need to create a multi-level menu system in my layout with data from the database. This data has to be available on every page, where do I make the call to the controller? In a helper?

    • CommentAuthormkhatib
    • CommentTimeMar 6th 2008
     

    In rails, there's the application_controller, so there you can put the action you want to get the data from the database for your menu, but for akelos i don't know if page_controller has the same functionality as application_controller in rails.

    • CommentAuthorsuthern
    • CommentTimeMar 6th 2008
     

    On EVERY page, or only on pages from a certain model?

    What I did for a footer (not data from a database) was to put a footer.tpl inside the "views \ layouts" folder. Then inside each model_name.tpl I inserted

    <%= render_partial 'layouts/footer' %>
    

    just under the line:

    <?php  echo  $content_for_layout ?>
    

    Perhaps not the best way to do it, but I couldn't find any documentation on application-wide render_partial's. Perhaps someone with more experiance than I can explain a better (global) way to do a database select and push to each model.

    • CommentAuthorKaste
    • CommentTimeMar 6th 2008
     

    application_controller has the same functionality as application_controller.

    but a helper combined with a partial is a good match and easier to test.

Add your comments
    Username Password
  • Format comments as