Hello everyone I am new to Rails, to web development and to web forums. This is my first ever web forum account and my first ever post to one. Let this show you just how much I want to learn RoR. Allow me to illustrate a problem I am having:
To make this clear lets just say I have a website that is just a really basic blog where users can register, login and post comments onto the main page.
So now say we have two controllers and two models
site controller comment controller user model comment model
users have id name
comments have id user_id cmnt varchar(255) like integer
OK so finally when a user goes to the website the first thing they see is the Index page which consists of all the comments entered by all users and each comment has a little link with text "I like this comment"
Each comment is in its own partial named _comment.rhtml and this resides in the views\site directory
now within _comment.rhtml we have
<div id="comment_<%= comment.id %>"> comment.cmnt comment.like </div> link_to_remote ("I Like this comment", :url => {:controller => "comment", :action => "add_like", :id => comment})
Now to spare you more details my problem is that my add_like function is in my comments controller and i have a add_like.rjs file in the comments view directory because that's where it looks for it. The problem is that in the rjs file which is basically just
page.replace_html("comment_#{@comment.id}", :partial => "comment")
it looks for _comment.rhtml in the quotes view directory!
I realize there's a whole lot of wrong stuff going on here but I hope that there are some ridiculously smart people here who will know what I'm getting at and help me through this obstacle. Any help is greatly appreciated.