Displaying 2 results from an estimated 2 matches for "posting_id".
2006 Jan 19
4
Relationships... not the personal kind!
...nts
belongs_to :user
end
class User < ActiveRecord::Base
has_many :comments
has_many :postings
end
In the comment_controller, how would I actually go about saving the
comment with the appropriate foreign keys of the posting and user. In
the comments table I have the appropriate columns (posting_id,
user_id).
Here''s what I have in the comment_controller for creating a new comment:
def new
@comment = Comment.new
end
def create
@comment = Comment.new(params[:comment])
@comment.users_ip = request.remote_ip
@comment.users = session[:user] <--- Doesn''t wo...
2006 Aug 04
3
ForumExample
Is ForumExample ( http://wiki.rubyonrails.com/rails/pages/ForumExample/
)
the best jumping off point for building in basic commenting
functionality?
Thanks,
Greg
--
Posted via http://www.ruby-forum.com/.