Once my Rail 3 app loads, then the user can click on the item that is then a dynamic subnet Have to load.
To click on a jQuery AJAX call on the server to click on my thinking (since it needs to be dynamic) and then inject a HTML response into a DIV on the page. .
Would you like to advise how the subway logic should be in the railway app, because I do not have a navigation controller or not ... but maybe I should be one?
Do I create a navigation controller? Or use the App Controller? I also have a page controller that I use for landing pages, about, contacts, etc. ...
Thanks!
For me, I have downloaded application controller development rather than an application controller, I will use
It should create a view folder in Application / ideas / navigation
. I will also put all of my navigation templates here (including the main NAV).
Therefore those files can be:
App / View / Navigation / _main_nav.html Erb # has given it to other pages subnav.html .erb # or subnav.js. To join erb, a partial file is created if you want AJAX call and return script
and in your layout files, where you want the main NAV, then you want to submit it.
So tomorrow you suddenly want two or three different navigation menus, and there are AJAX calls, you have a centralized location to control them, instead of putting them inside the application controller.
Another suggestion is to generate a navigation controller under some scopes such as app / controller / page_structure / navigation_controller.rb
, so your thoughts app / view / page_structure / In Navigation /
, you can keep things related to all your page structure in the same scope as the sidebar, custom headers, banners etc. within the framework of the page.
===== UPDATE =====
Since your AJAX call seems to be relatively stable, I recommend that your paths use a direct match .
If my guess is correct, then there are some items in your top navigation, and each item has its own sub-menu, then you want to load the sub-menu one by one, but not all. (If in fact it is all, you can only include them in presenting ...)
/ page_structures / top_nav /: sub_nav_template_name # So here I assume that You have to navigate multiple navigation and sub-nav
so we match the following for this action:
def get_sub_nav # both Parameter [: top_nav] and parameter [: sub_nav_template_name] exists and not pointing to any other dangerous place (I do not know Is this work if input is './' or '../' to present these things "Page_structure / navigation / # {params [: top_nav]} / # {params [sub_nav_template_name]}" end
With this simple action, whenever you add more navigation / navigation items, you need to create this Ajax response template. In this way, you are doing the least work!
Of course, if you have some items then return some other data as feedback Sector will need to respond to sub-categories such as, you may need to create other ways to pass the original class ID.
You might think like this: My suggestion is by default for a stable, stable centralized sub-ny, but if you need some special sub-nav, to process the other data If required, then each one of you will have to create a path in a navigation controller and to accept an action, your category id, product ID, etc. But still, this template file can follow the same filing method.
Comments
Post a Comment