Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6717415
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:50:56+00:00 2026-05-26T08:50:56+00:00

I have created an app that performs all CRUD operations remotely using Jquery. In

  • 0

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 %>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:50:56+00:00Added an answer on May 26, 2026 at 8:50 am

    It was simple as this. create an errors partial and an errors div in the view and….

    in create.js.coffee

    <% if @user.errors.any? %>
    $('<%= escape_javascript(render :partial => "errors", :locals => {:target => @user })%>')
       .appendTo('#errors')
    <% else %>
    $('<%= escape_javascript(render(:partial => @user))%>')
      .appendTo('#user_table')
      .hide()
      .fadeIn(200)
    
    $('#new_user')[0].reset()
    
    $('#users_count').html '<%= users_count %>'
    <% end %>
    $('#error_clo
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an app that uses NSTimer, which gets triggered each second. My
I have successfully created an app that reads from a bundled .plist file and
I have created a flexible navigation bar in my app that will show custom
I have created an ashx handler that returns an image to my flex app.
I have several buttons on my app that are being created dynamically. They are
I have an app.Config that was created on the dev machine running Windows 7.
I have a third-party app that creates HTML-based reports that I need to display.
I have an app that creates a variable number of ScatterviewItems based on which
I have a service app that creates AppDomain's during the course of its use
I have a PHP app that creates a CSV file which is forced to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.