app/views/guts/navigations/index.html.erb in guts-1.3.6 vs app/views/guts/navigations/index.html.erb in guts-1.4.0

- old
+ new

@@ -1,9 +1,9 @@ <div class="row"> <div class="small-12 columns"> <h1>Navigations</h1> - <%= link_to 'New', new_navigation_path, class: 'button' %> + <%= link_to('New', new_navigation_path, class: 'button') if can? :create, Guts::Navigation %> </div> </div> <% if notice %> <div class="row"> @@ -20,22 +20,22 @@ <% @navigations.each do |navigation| %> <div class="small-12 medium-6 columns nav_block"> <div class="callout secondary"> <h5><%= navigation.title %></h5> <div class="tiny button-group"> - <%= link_to 'New', new_navigation_navigation_item_path(navigation), { class: 'button' } %> - <%= link_to 'Edit', edit_navigation_path(navigation), { class: 'warning button' } %> - <%= link_to_destroy 'Destroy', navigation, { class: 'alert button' } %> + <%= link_to('New', new_navigation_navigation_item_path(navigation), { class: 'button' }) if can? :create, Guts::NavigationItem %> + <%= link_to('Edit', edit_navigation_path(navigation), { class: 'warning button' }) if can? :update, Guts::Navigation %> + <%= link_to_destroy('Destroy', navigation, { class: 'alert button' }) if can? :delete, Guts::Navigation %> </div> <ul class="sortable" data-url="<%= reorder_navigation_path navigation %>"> <% if navigation.navigation_items.size > 0 %> <% navigation.navigation_items.each do |item| %> <li class="item" data-id="<%= item.id %>"> <i class="handle fa fa-reorder"></i> <%= item.title %>&nbsp;&nbsp;&mdash;&gt;&nbsp;&nbsp;<%= item.custom? ? 'Custom' : item.navigatable.navigatable_format %> <%= "to: #{item.custom}" if item.custom? %> <div class="action_links"> - <%= link_to 'Edit', edit_navigation_navigation_item_path(navigation, item) %> - <%= link_to_destroy 'Destroy', navigation_navigation_item_path(navigation, item) %> + <%= link_to('Edit', edit_navigation_navigation_item_path(navigation, item)) if can? :update, Guts::NavigationItem %> + <%= link_to_destroy('Destroy', navigation_navigation_item_path(navigation, item)) if can? :delete, Guts::NavigationItem %> </div> </li> <% end %> <% else %> <p>No navigational items added to this menu.</p>