Formtastic does not save at all

Rails 3.1.3

I am using Formtastic gem in order to deal with multi-select
dependencies.

<%= semantic_form_for(@give) do |f| %>
<%= f.inputs do %>
<%= f.input :departure,
:collection => Departure.find(:all, :order=>:city).collect{ |c|
[c.city,c.id]},
:required=>true %>


<%= render :partial => ‘destination’ %>


<%= render :partial => ‘airline’ %>


<%= render :partial => ‘flight_name’ %>

<%= f.input :day_departure, :as => :date_select, :hint => ‘Select a
date’,
:start_year => Time.now.year,
:label => “Departure date” %>
<%= f.input :weight %>
<%= f.input :check_in %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :button_html => { :class => “btn btn-large
btn-primary” } %>
<% end %>
<% end %>

The partials and jQuery ajax functions work properly.

But the problem is the clicking the submit button does not do anything
at all!!!

If there is an error in saving the data, it should show some kind of
message in the console.
But the button simply does nothing.

I don’t think it matters, but the gives_controller is the following.

def create
@give = current_user.gives.build(params[:give])
respond_to do |format|
if @give.save
format.html { redirect_to @give, notice: ‘Give was successfully
created.’ }
format.json { render json: @give, status: :created, location:
@give }
else
format.html { render action: “new” }
format.json { render json: @give.errors, status:
:unprocessable_entity }
end
end
end

If there is at least an error, I may be able to provide more
information, but the submit action does not do anything, so I am stuck
here.

Can anyone guess where the problem is?

soichi

I had a similar problem, and you can read on what I found on github
https://github.com/rails/rails/issues/6701


Den lrdagen den 22:e september 2012 kl. 07:35:20 UTC+2 skrev
Ruby-Forum.com User:

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs