Class: Cathode::CustomAction

Inherits:
Action
  • Object
show all
Defined in:
lib/cathode/action.rb

Overview

Provides additional behavior for non-default actions.

Instance Attribute Summary

Attributes inherited from Action

#action_access_filter, #action_block, #http_method, #name, #override_block, #resource, #strong_params

Instance Method Summary collapse

Methods inherited from Action

#allowed?, create, #initialize

Methods included from ActionDsl

#actions, #custom_actions, #default_actions

Constructor Details

This class inherits a constructor from Cathode::Action

Instance Method Details

#after_initializeObject

Raises an error if the action was defined without an HTTP method



234
235
236
237
238
# File 'lib/cathode/action.rb', line 234

def after_initialize
  if http_method.nil?
    raise RequestMethodMissingError, "You must specify an HTTP method (get, put, post, delete) for action `#{@name}'"
  end
end