Sha256: 8664b41fbe4b69f68ecdfa425fef689cf797a1e08ec82b718771f33c78b757db
Contents?: true
Size: 1.09 KB
Versions: 7
Compression:
Stored size: 1.09 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('.edit_profile'), url: polymorphic_path([:edit, singular, :registration]) %> <%= render 'headmin/dropdown/divider' %> <%= render 'headmin/dropdown/item', name: t('.log_out'), url: polymorphic_path([:destroy, singular, :session]), method: :delete %> <% end %> <% end %>
Version data entries
7 entries across 7 versions & 1 rubygems