Sha256: 14f41ce280eaa02b2a58d9b43667777270dac5288a3f33b8b2f49adb9bc7d187

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

<%
  # headmin/dropdown/devise
  #
  # ==== Options
  # * <tt>scope</tt> - (symbol) devise scope, i.e. ':users' => current_user
  # * <tt>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

4 entries across 4 versions & 1 rubygems

Version Path
headmin-0.2.9 app/views/headmin/dropdown/_devise.html.erb
headmin-0.2.8 app/views/headmin/dropdown/_devise.html.erb
headmin-0.2.7 app/views/headmin/dropdown/_devise.html.erb
headmin-0.2.6 app/views/headmin/dropdown/_devise.html.erb