Module: Wicked::Controller::Concerns::RenderRedirect
- Extended by:
- ActiveSupport::Concern
- Included in:
- Action
- Defined in:
- lib/wicked/controller/concerns/render_redirect.rb
Instance Method Summary collapse
-
#finish_wizard_path ⇒ Object
TODO redirect to resource if one is passed to render_wizard.
- #process_resource!(resource) ⇒ Object
- #redirect_to_finish_wizard(options = nil) ⇒ Object
- #redirect_to_next(next_step) ⇒ Object
- #render_step(the_step, options = {}) ⇒ Object
- #render_wizard(resource = nil, options = {}) ⇒ Object
Instance Method Details
#finish_wizard_path ⇒ Object
TODO redirect to resource if one is passed to render_wizard
41 42 43 |
# File 'lib/wicked/controller/concerns/render_redirect.rb', line 41 def finish_wizard_path '/' end |
#process_resource!(resource) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/wicked/controller/concerns/render_redirect.rb', line 14 def process_resource!(resource) if resource if resource.save @skip_to ||= @next_step else @skip_to = nil end end end |
#redirect_to_finish_wizard(options = nil) ⇒ Object
45 46 47 |
# File 'lib/wicked/controller/concerns/render_redirect.rb', line 45 def redirect_to_finish_wizard( = nil) redirect_to finish_wizard_path, end |
#redirect_to_next(next_step) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/wicked/controller/concerns/render_redirect.rb', line 32 def redirect_to_next(next_step) if next_step.nil? redirect_to_finish_wizard else redirect_to wizard_path(next_step) end end |
#render_step(the_step, options = {}) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/wicked/controller/concerns/render_redirect.rb', line 24 def render_step(the_step, = {}) if the_step.nil? || the_step == :finish redirect_to_finish_wizard else render the_step, end end |
#render_wizard(resource = nil, options = {}) ⇒ Object
5 6 7 8 9 10 11 12 |
# File 'lib/wicked/controller/concerns/render_redirect.rb', line 5 def render_wizard(resource = nil, = {}) process_resource!(resource) if @skip_to redirect_to wizard_path(@skip_to), else render_step @step, end end |