I have created an app that performs all CRUD operations remotely using Jquery. In my views i have an index.html.erb that houses the form and a table that shows the records. My problem is when I submit the form with errors, I get no feedback. I believe my problem lies in my create.js.coffee file. I am using authlogic to handle validation on some portions of the form.
in create.js.coffee
$('<%= escape_javascript(render(:partial => @user))%>')
.appendTo('#user_table')
.hide()
.fadeIn(200)
$('#new_user')[0].reset()
$('#users_count').html '<%= users_count %>'
in index.html.erb
<% title "Create New User for XX" %>
<div id="paginate"><%= paginate @users, :remote => true %></div>
<div id="users_count"><strong><%= users_count %></strong></div>
<div id="users">
<table id="user_table">
<tr>
<th>Id</th>
<th>First</th>
<th>Last</th>
<th>Email</th>
<th>Last Login</th>
<th>Created At</th>
<th>Del</th>
<th>Edit</th>
</tr>
<%=render @users %>
</table>
</div>
<h3> Add new user below </h3>
<%= render :partial => 'form' %>
in _form.html.erb
<%= form_for User.new, :remote => true do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :fname %><br />
<%= f.text_field :fname %>
</p>
<p>
<%= f.label :lname %><br />
<%= f.text_field :lname %>
</p>
<p>
<%= f.label :email %><br />
<%= f.text_field :email %>
</p>
<p>
<%= f.label :admin %><br />
<%= f.check_box :admin %>
</p>
<p>
<%= f.label :password %><br />
<%= f.password_field :password %>
</p>
<p>
<%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation %>
</p>
<p><%= f.submit %></p>
<% end %>