Shandy Nantz wrote:

I have been seeingthis problem lots and I guess I must always work around it without understand why it's there, so maybe you all can help me. I have this form:

<%= form_remote_tag :update => "credit_card_table", :url => { :action => :add_credit_card, :id => @user }, :failure => 'alert("ERROR")', :html => { :id => 'credit_card_form' } %>

which checks the validation of a credit card number, adds it to the list if all is good, or pops up an error box if it is not. When it is not valid, the error box comes up but then in the field that I am updating i get:

Template is missing Missing template ./script/../config/../app/views/enroll/add_credit_card.rhtml

Now, I understand it is going and executing the code in the 'add_credit_card' method, but there is no 'add_credit_card.rhtml," there isn't meant to be. I simple want it so that if the validation fails, nothing happens after the user hit 'OK' on the pop-up box.

So I guess my question is, can someone explain why this is happening, and how to fix it? Thx,

When you call a Rails action it needs to return something. By default it tries to return a rendering of the corresponding template. If you don't have a template you will need to return something else. Typically you will use the "render" method for this. Check the API for details.