Sha256: 0febe7a354592e3a0a30cd4bccac8f8041dd4e9a6fe987e2d3e030bf35ea7638
Contents?: true
Size: 771 Bytes
Versions: 22
Compression:
Stored size: 771 Bytes
Contents
module Effective module WizardController module Save def save_wizard_resource(resource, action = nil, options = {}) was_new_record = resource.new_record? action ||= resource.respond_to?("#{step}!") ? step : :save if save_resource(resource, action) flash[:success] = options.delete(:success) || resource_flash(:success, resource, action) @skip_to ||= next_step @redirect_to ||= resource_wizard_path(resource, @skip_to) if was_new_record redirect_to(@redirect_to || wizard_path(@skip_to)) else flash.now[:danger] = options.delete(:error) || resource_flash(:danger, resource, action) render_step(wizard_value(step), options) end end end end end
Version data entries
22 entries across 22 versions & 1 rubygems