Sha256: 2d1b06deaf7123e981cfc35d111b9af93922c24c53aec33930546de20f6a81b5

Contents?: true

Size: 1.44 KB

Versions: 7

Compression:

Stored size: 1.44 KB

Contents

<li class="dropdown pull-right">
  <a href="#" data-toggle="dropdown">
    <%= translate_scoped("actions.label") %> <span class="caret"></span>
  </a>
  <ul class="dropdown-menu">
    <% if policy(@resource).show? && action_name != "show" %>
      <li>
        <%= link_to translate_scoped("actions.show"), [*@resource_parents, @resource] %>
      </li>
    <% end %>
    <% if policy(@resource).edit? && action_name != "edit" %>
      <li>
        <%= link_to translate_scoped("actions.edit"), [:edit, *@resource_parents, @resource]  %>
      </li>
    <% end %>
    <% if policy(@resource).destroy? %>
      <li>
        <%= link_to translate_scoped("actions.destroy"), [*@resource_parents, @resource], method: :delete,
          data: { confirm: translate_scoped("actions.confirm_message") } %>
      </li>
    <% end %>
  </ul>
</li>

<% if @resource_service.has_many_map.present? %>
  <li class="dropdown pull-right">
    <a href="#" data-toggle="dropdown">
      <%= translate_scoped("associations.label") %> <span class="caret"></span>
    </a>
    <ul class="dropdown-menu">
      <% @resource_service.has_many_map.each do |name, options| %>
        <% if policy(options[:class_name].constantize).index? %>
          <li>
            <%= link_to(options[:class_name].constantize.model_name.human(count: 2),
              send("#{@resource_class.name.underscore}_#{name}_path", @resource)) %>
          </li>
        <% end %>
      <% end %>
    </ul>
  </li>
<% end %>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
godmin-2.3.0 app/views/godmin/resource/_breadcrumb_actions.html.erb
godmin-2.2.2 app/views/godmin/resource/_breadcrumb_actions.html.erb
godmin-2.2.1 app/views/godmin/resource/_breadcrumb_actions.html.erb
godmin-2.2.0 app/views/godmin/resource/_breadcrumb_actions.html.erb
godmin-2.1.0 app/views/godmin/resource/_breadcrumb_actions.html.erb
godmin-2.0.0 app/views/godmin/resource/_breadcrumb_actions.html.erb
godmin-1.5.0 app/views/godmin/resource/_breadcrumb_actions.html.erb