I’m trying to make a method for a “Read more” link in my controller which will only count the click, i.e., do nothing except that. I’m using the impressionist gem to count the impressions which is all fine and dandy, but I want to count the clicks on my “Read more” links, and since the “Read more” links are only jQuery reveals there’s no other controller method for them.
This is what I’ve got so far, I just need to send the click result without leaving or reloading the page.
def read_more(a)
@article = Article(a)
impressionist(a)
end
I get this error when I click the link:
ActiveRecord::RecordNotFound (Couldn't find Doc with id=19)
When it should be looking for Article with an ID of 19.
Any thoughts would be a huge help. Cheers!
I figured out the answer, should anyone else come into a similar issue.
Apparently you can’t have arguments in controller methods.