Class: Codeprimate::Wizard::Base
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Codeprimate::Wizard::Base
- Defined in:
- lib/wizard_controller.rb
Class Attribute Summary collapse
-
.abort_path ⇒ Object
Returns the value of attribute abort_path.
-
.finish_path ⇒ Object
Returns the value of attribute finish_path.
-
.wizard_default_error ⇒ Object
Returns the value of attribute wizard_default_error.
-
.wizard_steps ⇒ Object
Returns the value of attribute wizard_steps.
Class Method Summary collapse
- .define_steps(*args) ⇒ Object
- .set_abort_path(p) ⇒ Object
- .set_default_error(e) ⇒ Object
- .set_finish_path(p) ⇒ Object
Instance Method Summary collapse
- #index ⇒ Object
- #next_step ⇒ Object
- #previous_step ⇒ Object
- #reset ⇒ Object
-
#set_abort_path(p) ⇒ Object
PUBLIC ACTIONS.
Class Attribute Details
.abort_path ⇒ Object
Returns the value of attribute abort_path.
14 15 16 |
# File 'lib/wizard_controller.rb', line 14 def abort_path @abort_path end |
.finish_path ⇒ Object
Returns the value of attribute finish_path.
14 15 16 |
# File 'lib/wizard_controller.rb', line 14 def finish_path @finish_path end |
.wizard_default_error ⇒ Object
Returns the value of attribute wizard_default_error.
14 15 16 |
# File 'lib/wizard_controller.rb', line 14 def wizard_default_error @wizard_default_error end |
.wizard_steps ⇒ Object
Returns the value of attribute wizard_steps.
14 15 16 |
# File 'lib/wizard_controller.rb', line 14 def wizard_steps @wizard_steps end |
Class Method Details
.define_steps(*args) ⇒ Object
16 17 18 |
# File 'lib/wizard_controller.rb', line 16 def define_steps(*args) self.wizard_steps = args end |
.set_abort_path(p) ⇒ Object
24 25 26 |
# File 'lib/wizard_controller.rb', line 24 def set_abort_path(p) self.abort_path = p end |
.set_default_error(e) ⇒ Object
28 29 30 |
# File 'lib/wizard_controller.rb', line 28 def set_default_error(e) self.wizard_default_error = e end |
.set_finish_path(p) ⇒ Object
20 21 22 |
# File 'lib/wizard_controller.rb', line 20 def set_finish_path(p) self.finish_path = p end |
Instance Method Details
#index ⇒ Object
39 40 41 42 43 44 45 |
# File 'lib/wizard_controller.rb', line 39 def index if finished handle_finished_wizard else handle_unfinished_wizard end end |
#next_step ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/wizard_controller.rb', line 47 def next_step if step_completed incr_step else flash[:error] ||= self.class.wizard_default_error end self.finish_path = params[:redirect] unless params[:redirect].blank? redirect_to :action => :index end |
#previous_step ⇒ Object
57 58 59 60 |
# File 'lib/wizard_controller.rb', line 57 def previous_step decr_step redirect_to :action => :index end |
#reset ⇒ Object
62 63 64 65 |
# File 'lib/wizard_controller.rb', line 62 def reset reset_wizard redirect_to :action => :index end |
#set_abort_path(p) ⇒ Object
PUBLIC ACTIONS
35 36 37 |
# File 'lib/wizard_controller.rb', line 35 def set_abort_path(p) self.abort_path = p end |