Displaying 2 results from an estimated 2 matches for "usercomment".
Did you mean:
  user_comment
  
2011 Jan 26
13
undefined method `model_name' for NilClass:Class
...3:     <div id="errorExplanation">
4:       <h2><%= pluralize(@user_comment.errors.count, "error") %>
prohibited this user comment from being saved:</h2>
(1) What exactly does this error message mean?  From other posts I
gather this is a null instance of UserComments, but this is to create a
new instance?
(2) What are the step-by-step methods I should follow to debug such
issues?
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...
2006 Nov 27
3
ActiveRecord: Reference same table twice
...elationship work, but i''m not having any luck :(, can
anyone help in making this second link?
Here is what I have *working* in my models:
# user.rb
class User < ActiveRecord::Base
  has_many :user_comments, :order => ''created_at DESC''
end
# user_comments.rb
class UserComment < ActiveRecord::Base
  belongs_to :user
end
So far, this will allow me to get all comments associated with a user,
eg, "@user.user_comments".
This is what I want to be able to do in my view, to get the person who
posted the comment:
view.rhtml
----------
<h3>Comments</h3>...