You dont necessarily need to use the FormToWizard plugin for this especially if you just want to add a couple of steps and not another whole form page. First, I would take a look at Ryan Bates Railscast on Dynamic Select Menus. This is the technique I used and it worked great.
Here is my form. The location input is only added when "In Person" is chosen from the meettype select menu
<div class="row">
<div class="span6 offset3">
<h1>Post a Meeting</h1>
<%= simple_form_for @meeting do |f| %>
<%= render 'shared/error_messages', object: f.object %>
<%= f.input :meettype, :collection => ["In Person", "Skype", "Phone"], label: "Meeting Format" %>
<div class="field">
<%= f.label "Meeting Location" %>
<%= f.text_field :location, placeholder: "Location Address" %>
</div>
<center><%= f.submit "Post Meeting", class: "btn btn-large btn-primary" %></center>
</div>
</div>
Here is my meeting.js.coffee file which checks the value of the meettype selection input and either shows or hides the location input field based on the meettype selected.
jQuery ->
location = $('#meeting_location').html()
mt = $('#meeting_meettype :selected').text()
if mt != "In Person"
$('#meeting_location').parent().hide()
else
$('#meeting_location').parent().show()
$('#meeting_meettype').change ->
meettype = $('#meeting_meettype :selected').text()
if meettype =="In Person"
$('#meeting_location').html()
$('#meeting_location').parent().show()
else
$('#meeting_location').empty()
$('#meeting_location').parent().hide()
Using FormtoWizard plugin you can add the following lines of code to your FormtoWizard.js file. The added lines currently look at a collection input field in this case it is on a form labeled user and the input field name is option. If "Foo" is selected then the "Next" button appears and the user can continue on to the next page otherwise the submit button is shown and they can submit their form.
steps.each(function(i) {
$(this).wrap("<div id='step" + i + "'></div>");
$(this).append("<p id='step" + i + "commands'></p>");
var name = $(this).find("legend").html();
//Add a selection variable to keep track of whatever input you want
var select = $('#user_option :selected').text();
$("#step" + 1).hide();
$("#steps").append("<li id='stepDesc" + i + "'>Step " + (i + 1) + "<span>" + name + "</span></li>");
//If you are on the second part of the form hide the "Next" button and show "Submit"
if (i>0){
$("#" + stepName + "Next").parent.hide();
$(submmitButtonName).show();
}
//When the user selects a certain value the "Next" button will appear to direct them to the next form.
$("#user_option").on("change", function(e) {
select = $('#user_option :selected').text();
if (select == "Foo") {
createNextButton(i);
selectStep(i);
}
else {
$(submmitButtonName).show();
}
});
});