Ruby on Rails Monday, February 28, 2011

Hi,

Within your view: I would say you need to replace "do |user_comment|"
with something else like "do |u|"

There are no errors in your controller for the new action.

I see you said:

""Show" of User should let you create a
new comment."

Part of the Rails framework is the convention of mapping new the view to
the controller action. Example:
new.html.erb will be mapped to new action in controller
show.html.erb will be mapped to show action in controller.

If you are trying to get your new.html.erb to call the show action in
your controller, then this will be the cause of your error, as in show
action in the controller, you can see that the action is expecting a
UserComment to be there already by finding by id:
UserComment.find(params[:id]).

This will lead to a null error.

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment