module AutoBreadcrumbs::Controller
Private Instance Methods
action_translation(resources_name = nil, action_name = nil)
click to toggle source
# File lib/auto_breadcrumbs/controller.rb, line 48 def action_translation(resources_name = nil, action_name = nil) resources_name ||= params[:controller] action_name ||= params[:action] mapped_action_name = breadcrumbs_action_name(action_name) unless mapped_action_name == 'index' breadcrumbs_t("controllers.#{ resources_name }.#{ mapped_action_name }") || breadcrumbs_t("actions.#{ mapped_action_name }") || mapped_action_name.humanize end end
index_path(resources_name)
click to toggle source
# File lib/auto_breadcrumbs/controller.rb, line 61 def index_path(resources_name) url_for(controller: resources_name) rescue nil end
resource_translation(resources_name = nil)
click to toggle source
# File lib/auto_breadcrumbs/controller.rb, line 39 def resource_translation(resources_name = nil) resources_name ||= params[:controller] if index_path(resources_name) breadcrumbs_t("controllers.#{ resources_name }.index") || resources_name.humanize end end