|
35 | 35 | # navigation.ignore_query_params_on_auto_highlight = true |
36 | 36 | # navigation.ignore_anchors_on_auto_highlight = true |
37 | 37 |
|
38 | | - # If this option is set to true, all item names will be considered as safe (passed through html_safe). Defaults to false. |
| 38 | + # If this option is set to true, all item names will be considered as safe |
| 39 | + # (passed through html_safe). Defaults to false. |
39 | 40 | # navigation.consider_item_names_as_safe = false |
40 | 41 |
|
41 | 42 | # Define the primary navigation |
42 | 43 | navigation.items do |primary| |
43 | 44 | # Add an item to the primary navigation. The following params apply: |
44 | 45 | # key - a symbol which uniquely defines your navigation item in the scope of the primary_navigation |
45 | 46 | # name - will be displayed in the rendered navigation. This can also be a call to your I18n-framework. |
46 | | - # url - the address that the generated item links to. You can also use url_helpers (named routes, restful routes helper, url_for etc.) |
47 | | - # options - can be used to specify attributes that will be included in the rendered navigation item (e.g. id, class etc.) |
| 47 | + # url - the address that the generated item links to. You can also use url_helpers |
| 48 | + # (named routes, restful routes helper, url_for etc.) |
| 49 | + # options - can be used to specify attributes that will be included in the rendered |
| 50 | + # navigation item (e.g. id, class etc.) |
48 | 51 | # some special options that can be set: |
49 | 52 | # :html - Specifies html attributes that will be included in the rendered navigation item |
50 | 53 | # :if - Specifies a proc to call to determine if the item should |
|
58 | 61 | # when the item should be highlighted, you can set a regexp which is matched |
59 | 62 | # against the current URI. You may also use a proc, or the symbol <tt>:subpath</tt>. |
60 | 63 | # |
61 | | - primary.item :key_1, 'name', url, options |
| 64 | + primary.item :key1, 'name', url, options |
62 | 65 |
|
63 | 66 | # Add an item which has a sub navigation (same params, but with block) |
64 | | - primary.item :key_2, 'name', url, options do |sub_nav| |
| 67 | + primary.item :key2, 'name', url, options do |sub_nav| |
65 | 68 | # Add an item to the sub navigation (same params again) |
66 | | - sub_nav.item :key_2_1, 'name', url, options |
| 69 | + sub_nav.item :key21, 'name', url, options |
67 | 70 | end |
68 | 71 |
|
69 | 72 | # You can also specify a condition-proc that needs to be fullfilled to display an item. |
70 | 73 | # Conditions are part of the options. They are evaluated in the context of the views, |
71 | 74 | # thus you can use all the methods and vars you have available in the views. |
72 | | - primary.item :key_3, 'Admin', url, html: { class: 'special' }, if: -> { current_user.admin? } |
73 | | - primary.item :key_4, 'Account', url, unless: -> { logged_in? } |
| 75 | + primary.item :key3, 'Admin', url, html: { class: 'special' }, if: -> { current_user.admin? } |
| 76 | + primary.item :key4, 'Account', url, unless: -> { logged_in? } |
74 | 77 |
|
75 | 78 | # you can also specify html attributes to attach to this particular level |
76 | 79 | # works for all levels of the menu |
|
0 commit comments