I have a page displaying a form and a table. The form is used to add
record to the table using ajax.
I am using jQeury for this.
Submitting the form with all fields filled in works just fine, but
when I leave field empty it does not work.
Probably because the jQuery code tries to add a partial (containing
one row) to to the bottom of the table for the new object that could
not be created because fields where empty.
My create action now looks like this:
def create
@project = Project.new(params[:project])
@project.save
@current_project = @project
flash[:notice] = 'Successfully created project.'
respond_to do |format|
format.js
format.html { redirect_to projects_url }
end
end
What do I have to add to my code in order to get the form validation
to work properly with my ajax form?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---