Class: Shoulda::Controller::ResourceOptions::ActionOptions
- Inherits:
-
Object
- Object
- Shoulda::Controller::ResourceOptions::ActionOptions
- Defined in:
- lib/shoulda/controller/resource_options.rb
Overview
Configuration options for the create, update, destroy actions under should_be_restful
Instance Attribute Summary collapse
-
#flash ⇒ Object
String or Regexp describing a value expected in the flash.
-
#params ⇒ Object
Hash describing the params that should be sent in with this action.
-
#redirect ⇒ Object
String evaled to get the target of the redirection.
Instance Attribute Details
#flash ⇒ Object
String or Regexp describing a value expected in the flash. Will match against any flash key.
Defaults:
- destroy
-
/removed/
- create
-
/created/
- update
-
/updated/
63 64 65 |
# File 'lib/shoulda/controller/resource_options.rb', line 63 def flash @flash end |
#params ⇒ Object
Hash describing the params that should be sent in with this action.
66 67 68 |
# File 'lib/shoulda/controller/resource_options.rb', line 66 def params @params end |
#redirect ⇒ Object
String evaled to get the target of the redirection. All of the instance variables set by the controller will be available to the evaled code.
Example:
resource.create.redirect = "user_url(@user.company, @user)"
Defaults to a generated url based on the name of the controller, the action, and the resource.parents list.
55 56 57 |
# File 'lib/shoulda/controller/resource_options.rb', line 55 def redirect @redirect end |