Sha256: e9336931cc3fef63bff7fd1bf6e943a3d45139f34ddab6443bd00e4f9ce009a0
Contents?: true
Size: 1.12 KB
Versions: 13
Compression:
Stored size: 1.12 KB
Contents
<% # headmin/dropdown/devise # # ==== Options # * +scope</tt> - (symbol) devise scope, i.e. ":users" => current_user # * +class</tt> - Custom class names to put on the dropdown # # ==== Examples # Basic version # <%= render "headmin/dropdown/devise" %#> # # Custom scope # <%= render "headmin/dropdown/devise", scope: :admins %#> class_names = local_assigns.has_key?(:class) ? local_assigns[:class] : "" scope = local_assigns.has_key?(:scope) ? scope : :users singular = scope.to_s.singularize.to_sym user = send("current_#{singular}") %> <%= render "headmin/dropdown", class: class_names do %> <%= render "headmin/dropdown/button" do %> <%= user.to_s %> <% end %> <%= render "headmin/dropdown/list", class: "dropdown-menu-end" do %> <%= render "headmin/dropdown/item", name: t("headmin.dropdown.devise.edit_profile"), url: polymorphic_path([:edit, :admin, user]) %> <%= render "headmin/dropdown/divider" %> <%= render "headmin/dropdown/item", name: t("headmin.dropdown.devise.log_out"), url: polymorphic_path([:destroy, singular, :session]), method: :delete %> <% end %> <% end %>
Version data entries
13 entries across 13 versions & 1 rubygems