Craig Demyanovich wrote:
> Instead of
> 
> <%= error_messages_for 'customer' %>
> 
> which is telling error_messages_for to display errors for the string
> 'customer', which I don't expect to ever work, you should probably use
> 
> <%= error_messages_for @customer %>
> 
> assuming that your controller action sets @customer for use by the view. 
> If
> that's not the case, could you show us the code for your action?
> 
> Regards,
> Craig

Thank Craig for the reply. I did as you said but ended up getting error 
"@<Customer not allowed" something like this, so I instead did the other 
way:
def checkout
 customer = Customer.new
end

and then: <%=error_messages_for 'customer'%>

it worked but I get ugly underline in customer = Customer.new saying 
that customer hasn't been used. Also I have made .css file for the 
flash[:notice] but its not getting applied to the generated error 
message while it does to other error msgs. By the way the above 
mentioned checkout action is exactly as I've put in the controller and 
in the view as I've mentioned in my 1st post. Thanks.
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to