On 16 Feb 2009, at 15:27, bingo bob wrote: > > > I'd like to show validation errors in the initial form, so how do I do > the line... > > <% form_for [...@school, Review.new] do |f| %> >
You don't want Review.new. You want to use the instance of review that had the errors on it. This will also means that the text boxes etc. will be filled with what the user typed in before. You can use f.error_messages_for to display the errors or you can roll your own thing if you don't like the output that generates but the key thing is that you need to use th instance which has errors on it. Fred > Is that right? > > > I realise i need to update the controller to render new if the record > doesnt save... > -- > 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 -~----------~----~----~----~------~----~------~--~---

