Module: RailsAdmin::ApplicationHelper
- Includes:
- I18nSupport
- Defined in:
- app/helpers/rails_admin/application_helper.rb
Defined Under Namespace
Classes: ViewType
Constant Summary collapse
- VIEW_TYPES =
{ :delete => ViewType.new(:show, :object, :delete), :for_object => ViewType.new(:show, :object, nil, :history_object), :edit => ViewType.new(:show, :object, :edit), :show => ViewType.new(:index, :object, nil), :export => ViewType.new(:index, :model, :export), :new => ViewType.new(:index, :model, :new), :for_model => ViewType.new(:index, :model, nil, :history_model), :index => ViewType.new(:dashboard, :model, :index), :dashboard => ViewType.new }
Instance Method Summary collapse
Methods included from I18nSupport
#abbr_day_names, #abbr_month_names, #date_format, #day_names, #month_names
Instance Method Details
#authorized?(*args) ⇒ Boolean
8 9 10 |
# File 'app/helpers/rails_admin/application_helper.rb', line 8 def (*args) @authorization_adapter.nil? || @authorization_adapter.(*args) end |
#breadcrumbs_for(view, abstract_model, object) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/helpers/rails_admin/application_helper.rb', line 26 def view, abstract_model, object return unless VIEW_TYPES[view] views = [] parent = view begin views << parent end while parent = VIEW_TYPES[parent].parent = views.reverse.map do |v| v, abstract_model, object, (v==view) end content_tag(:ul, :class => "breadcrumb") do .join('<span class="divider">/</span>').html_safe end end |