wicked-gem

Multiple Submit Options with wizard form and Wicked gem

时光怂恿深爱的人放手 提交于 2020-01-25 11:31:46
问题 I looked at Wicked documentation, but can't seem to figure out my problem. I have a multipage wizard form, and on this page I have 4 buttons. I need each button to update a specific attribute in my model, and also submit the form at the same time. I tried to do this with 4 different submit buttons unsuccessfully. I think the best way to do it would be to have a custom url and pass in a param, but not sure how to do this with Wicked. Example [button_a] => wizard_path, {option: "a"} [button_b]

Multiple Submit Options with wizard form and Wicked gem

不想你离开。 提交于 2020-01-25 11:31:07
问题 I looked at Wicked documentation, but can't seem to figure out my problem. I have a multipage wizard form, and on this page I have 4 buttons. I need each button to update a specific attribute in my model, and also submit the form at the same time. I tried to do this with 4 different submit buttons unsuccessfully. I think the best way to do it would be to have a custom url and pass in a param, but not sure how to do this with Wicked. Example [button_a] => wizard_path, {option: "a"} [button_b]

Rails partial validations depending on conrtoller

北城余情 提交于 2020-01-25 06:42:18
问题 I am using devise for user registrations, meaning, that by default new user is registered through registrations_controller. So by clicking button "Register" user is redirected to a new_user_registration path. My registration form however has two steps. In first step (new_user_registration) I am asking for a name and password. In the second step (users_controller), when user is saved, I am asking for address. This I am doing with wizard gem: def create @user = User.new(params[:user]) if @user

Rails partial validations depending on conrtoller

喜你入骨 提交于 2020-01-25 06:42:14
问题 I am using devise for user registrations, meaning, that by default new user is registered through registrations_controller. So by clicking button "Register" user is redirected to a new_user_registration path. My registration form however has two steps. In first step (new_user_registration) I am asking for a name and password. In the second step (users_controller), when user is saved, I am asking for address. This I am doing with wizard gem: def create @user = User.new(params[:user]) if @user

nested model attributes + wicked wizard form not working

你说的曾经没有我的故事 提交于 2019-12-23 02:17:26
问题 I am making an app based on the railscast tutorial 346(Wicked gem) and 196(nested model). I am trying to combine these 2 together and I am stuck because strong param attributes are not saving. So my app goes like this: I have a user, work, and education model. user.rb: has_many :educations, dependent: :destroy has_many :works, dependent: :destroy accepts_nested_attributes_for :educations, :works education.rb belongs_to :user work.rb belongs_to :user And then i generated the wicked wizard

Wicked gem cannot find wedding ID in update action

自作多情 提交于 2019-12-22 10:36:04
问题 I'm trying to implement the 'Wicked' gem for wizards and cannot figure out this error for the life of me. Already referenced Ryan bates railscast #346 and the step by step tutorial by schneems. I have 2 controllers: Weddings and Wedding_steps. The user initially creates a Wedding and after the create action is redirected to the Wedding_steps controller (which uses Wicked) to update the wedding model with additional info. The wedding_id is successfully detected in the first step weddingdetails

Wicked Wizard dynamic step order

安稳与你 提交于 2019-12-12 22:03:21
问题 I'm trying to alter the order of the steps in wicked wizard based on the selections form a previous selection. So currently I have all the steps: class WWTestController < ApplicationController include Wicked::Wizard steps :first_page,:optional_page,:second_page def show @event_object = EventObject.find(params[:event_object_id]) render_wizard end def update @event_object = EventObject.find(params[:event_object_id]) @event_object.update_attributes(event_object_params) render_wizard @event

Rails Wicked Gem - Understanding routing

元气小坏坏 提交于 2019-12-12 02:07:02
问题 Okay, so I'm not really understanding nested routing in the wicked gem. So far I have this. I'm not sure if everything is in the right folder or if I'm doing that right. routes.rb resources :events resources :events do resources :build, controller: 'events/build' end controllers/events_controller.rb def create @event = Event.new(event_params) if @event.save flash[:success] = "Event Created!" redirect_to event_build_path(event_id: "event", id: @event.id) # previously had redirect_to event

Wicked Gem with cocoon gem and devise user model

江枫思渺然 提交于 2019-12-11 11:44:14
问题 So I have a User model generated with devise , and I am using Wicked gem to give me multiform option on taking more data from the user and storing it in the user model. Everything is working fine but know I'm trying to add another model where user has many degree. I am using cocoon gem to allow me to add extra degrees . I am able to go to the multiform page and enter degree information and even add many more degrees to the user, but when i submit the form i get an error; param is missing or

nested model attributes + wicked wizard form not working

北城余情 提交于 2019-12-07 11:17:29
I am making an app based on the railscast tutorial 346(Wicked gem) and 196(nested model). I am trying to combine these 2 together and I am stuck because strong param attributes are not saving. So my app goes like this: I have a user, work, and education model. user.rb: has_many :educations, dependent: :destroy has_many :works, dependent: :destroy accepts_nested_attributes_for :educations, :works education.rb belongs_to :user work.rb belongs_to :user And then i generated the wicked wizard controller which i called UserStepsController: include Wicked::Wizard steps :education, :work def show