Class: Shoulda::Controller::ResourceOptions::ActionOptions

Inherits:
Object
  • Object
show all
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

Instance Attribute Details

#flashObject

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

#paramsObject

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

#redirectObject

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