module Kea::Controller

Attributes

running_via_kea[RW]

Public Instance Methods

params() click to toggle source
# File lib/kea/controller.rb, line 15
def params
  if @running_via_kea
    if request.env['kea.params'].present?
      request.env['kea.params']['params']
    else
      request.params['params']
    end
  else
    if request.env['kea.params'].present?
      request.env['kea.params']
    else
      request.params
    end
  end
end
render_props_or_component() click to toggle source
# File lib/kea/controller.rb, line 31
def render_props_or_component
  respond_to do |format|
    format.html { render 'kea/component' }
    format.json { render json: @props }
  end
end
run_kea_action() click to toggle source
# File lib/kea/controller.rb, line 5
def run_kea_action
  active_method = params['method']
  if self.respond_to? active_method
    @running_via_kea = true
    self.send(active_method)
  else
    raise Kea::ActionNotFoundError
  end
end