Show validation error messages from a nested model?

42 views
Skip to first unread message

JL Smith

unread,
Aug 10, 2009, 10:46:46 PM8/10/09
to Ruby on Rails: Talk
I'm trying to get error messages from a child object to show up on the
view page of the parent object. Line #7 of show view is what I'm
trying to do. What am I missing? If I enter a comment that is less
than 30 characters, I should see some validation errors, no? Thanks
for any help.

http://gist.github.com/165593

Sijo Kg

unread,
Aug 11, 2009, 1:04:57 AM8/11/09
to rubyonra...@googlegroups.com
Hi

format.html { render :action => "new" } this says to render new
action of comments controller Is that you need or you have to render
show action of movie If that then you can say

render :action => "../movies/show"

instaed of format.html { render :action => "new" }


Sijo
--
Posted via http://www.ruby-forum.com/.

JL Smith

unread,
Aug 11, 2009, 11:54:34 AM8/11/09
to Ruby on Rails: Talk
I see what you're saying. I need to redirect from comments controller
right back to where I was (show action of movies controller). But
with the render, how do I specify the id to the movie that I'm
returning to? Thanks for the help.
Reply all
Reply to author
Forward
0 new messages