Module: Releaf::ActionController::Views

Extended by:
ActiveSupport::Concern
Included in:
Releaf::ActionController
Defined in:
app/lib/releaf/action_controller/views.rb

Instance Method Summary collapse

Instance Method Details

#action_view(name_of_action) ⇒ Object

Returns generic view name for given action

Returns:

  • String



20
21
22
# File 'app/lib/releaf/action_controller/views.rb', line 20

def action_view(name_of_action)
  action_views[name_of_action.to_sym] || name_of_action
end

#action_viewsObject

Returns action > view translation hash

Returns:

  • Hash



10
11
12
13
14
15
16
# File 'app/lib/releaf/action_controller/views.rb', line 10

def action_views
  {
    new: :edit,
    update: :edit,
    create: :edit,
  }
end

#active_viewObject

Returns generic view name for current action

Returns:

  • String



26
27
28
# File 'app/lib/releaf/action_controller/views.rb', line 26

def active_view
  action_view(action_name)
end