Try the following:
challenges_controller
def new @form = ChallengeForm.new(Challenge.new) respond_modal_with @form, location: root_path end def create challenge = Challenge.new(challenge_params) @form = ChallengeForm.new(challenge) if params[:step] == '2' @form.validate(user_id: current_user.id) @form.save redirect_to challenge end end
Problems /new.html.erb
<%= simple_form_for @form, html: { data: { modal: true } }, url: 'your_challenge_create_path', method: :post do |f| %> <%= f.text_field :action, placeholder: 'Enter a Custom Challenge' %><br> Or choose a featured challenge: <%= f.collection_radio_buttons :action, [['Run a Mile','Run a Mile'], ['Drink 16oz of Water','Drink 16oz of Water'], ['Take a Picture','Take a Picture'], ['1 Drink Max','1 Drink Max'], ['See Eiffel Tower','See Eiffel Tower'], ['Write a Book','Write a Book'], ['Skydive','Skydive'], ['Start a Business','Start a Business'], ['No Snooze','No Snooze'], ['Visit All 50 States','Visit All 50 States'], ['Talk to a Stranger','Talk to a Stranger'], ['Try a New Recipe','Try a New Recipe'], ['Media-fast','Media-fast']], :first, :last %> <%= f.submit %> <% end %>
Problems /create.html.erb
<%= simple_form_for @form, html: { data: { modal: true } }, url: 'your_challenge_create_path', method: :post do |f| %> <%= hidden_field_tag :step, 2 %> Challenge: <%= f.text_field :action %> Do For: <%= f.number_field :days_challenged %> Do On: <%= f.collection_check_boxes :committed %> <% end %>
I may be a little from you, but do you understand?