I'm trying to figure out how to structure my path on a link_to_remote tag to accommodate nested routes. I have an article model that belongs to a group model, and the article has votes associated with it (using the Vote_Fu plugin). I created the code for articles first and it worked, but in the process of adding the group model and updating my paths for everything, the link below is now broken. I know it's looking for new_question_path which won't work anymore, but I can't figure out what to replace it with.
<%= link_to_remote "+(#{@article.votes_for})",
:update=>"vote",
:url => { :controller=>"articles",
:action=>"vote",
:id=>@article.id,
:vote=>"for"},
:html => { :class => "up" } %>
Any help would be awesome. Thanks!
UPDATE:
Looks like the issue was in my routes. I have a vote method in my articles controller, but it didn't know to look for that. I changed my routes.rb file to this:
group.resources :articles, :member => { :vote => :get }
Looks like the problem might be solved.