module ActionHandler::Equip
Equip
implements most basic functionality of controller for handler.
Public Class Methods
included(handler_class)
click to toggle source
# File lib/action_handler/equip.rb, line 30 def self.included(handler_class) ActionHandler::Config.set(handler_class, ActionHandler::Config.new) handler_class.extend ActionHandler::HandlerExtension handler_class.args ActionHandler::Args::Default.new end
Public Instance Methods
redirect_to(*args)
click to toggle source
# File lib/action_handler/equip.rb, line 22 def redirect_to(*args) ActionHandler::Call.new(:redirect_to, args) end
render(props)
click to toggle source
Return the argument as is, because the actual rendering is done in a controller. This just makes returning values more easy. Without this:
{ status: :ok, json: user.to_json }
With this (no braces):
render status: :ok, json: user.to_json
# File lib/action_handler/equip.rb, line 18 def render(props) props end
urls()
click to toggle source
# File lib/action_handler/equip.rb, line 26 def urls Rails.application.routes.url_helpers end