Class: AasmActionable::StateAction
- Inherits:
-
Object
- Object
- AasmActionable::StateAction
- Defined in:
- lib/aasm_actionable/controller_mixin.rb
Overview
A StateAction groups together the various attributes for an action being rendered, such as it’s title, HTML ID, and the name of the partial to render.
Note that the HTML ID is not unique, so it is not currently possible to call render_state_actions multiple times for the same taskable type on one page.
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#partial ⇒ Object
readonly
Returns the value of attribute partial.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(event, action_view_prefix) ⇒ StateAction
constructor
A new instance of StateAction.
Constructor Details
#initialize(event, action_view_prefix) ⇒ StateAction
14 15 16 17 18 |
# File 'lib/aasm_actionable/controller_mixin.rb', line 14 def initialize(event, action_view_prefix) @title = event.to_s.titleize @id = "action-#{event}" @partial = "#{action_view_prefix}/#{event}" end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
12 13 14 |
# File 'lib/aasm_actionable/controller_mixin.rb', line 12 def id @id end |
#partial ⇒ Object (readonly)
Returns the value of attribute partial.
12 13 14 |
# File 'lib/aasm_actionable/controller_mixin.rb', line 12 def partial @partial end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
12 13 14 |
# File 'lib/aasm_actionable/controller_mixin.rb', line 12 def title @title end |