[see later answer for more]
I think this is just a simple rails question, and mostly on how i’ve named my models and reference them in my view. So a little background, I’m using the vote_fu plugin, which I think is great, however I’m having a hard time getting the voting to work from a link as follows:
<%= link_to "vote for", current_user.vote_for(answer) %>
Where current_user is a helper and returns the current user that is logged in making this request, the issue is likely in the way I state answer which belongs to my question model,
any help is really appreciated, even if you just help me down the right path!
oh! also it works in console… so if I do:
user = User.find(1)
user.vote_for(Question.last)
It works as expected.
current_user.vote_for(answer)will call that method right away. Just because it’s in :url doesn’t mean it gets any special treatment. It’ll be executed just like any other ruby method.You probably want to do something like this.