Sha256: ec94ab755d5c7e56f38e69dd2080e020a8d6a12de26d0e2b94f05c2365e3feb2

Contents?: true

Size: 572 Bytes

Versions: 43

Compression:

Stored size: 572 Bytes

Contents

module Releaf::ActionController::Views
  extend ActiveSupport::Concern

  included do
    helper_method :active_view
  end

  # Returns action > view translation hash
  # @return Hash
  def action_views
    {
      new: :edit,
      update: :edit,
      create: :edit,
    }
  end

  # Returns generic view name for given action
  # @return String
  def action_view(name_of_action)
    action_views[name_of_action.to_sym] || name_of_action
  end

  # Returns generic view name for current action
  # @return String
  def active_view
    action_view(action_name)
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
releaf-core-3.1.0 app/lib/releaf/action_controller/views.rb
releaf-core-3.0.3 app/lib/releaf/action_controller/views.rb
releaf-core-3.0.2 app/lib/releaf/action_controller/views.rb
releaf-core-3.0.1 app/lib/releaf/action_controller/views.rb
releaf-core-3.0.0 app/lib/releaf/action_controller/views.rb
releaf-core-2.2.1 app/lib/releaf/action_controller/views.rb
releaf-core-2.2.0 app/lib/releaf/action_controller/views.rb
releaf-core-2.1.2 app/lib/releaf/action_controller/views.rb
releaf-core-2.1.1 app/lib/releaf/action_controller/views.rb
releaf-core-2.1.0 app/lib/releaf/action_controller/views.rb
releaf-core-2.0.1 app/lib/releaf/action_controller/views.rb
releaf-core-2.0.0 app/lib/releaf/action_controller/views.rb
releaf-core-1.1.22 app/lib/releaf/action_controller/views.rb
releaf-core-1.1.21 app/lib/releaf/action_controller/views.rb
releaf-core-1.1.20 app/lib/releaf/action_controller/views.rb
releaf-core-1.1.19 app/lib/releaf/action_controller/views.rb
releaf-core-1.1.18 app/lib/releaf/action_controller/views.rb
releaf-core-1.1.17 app/lib/releaf/action_controller/views.rb
releaf-core-1.1.16 app/lib/releaf/action_controller/views.rb
releaf-core-1.1.15 app/lib/releaf/action_controller/views.rb