I am trying to use link_to_remote to simply add a record to a database
table called “ratings”. I’ve seen some examples of this being done but
can’t seem to get it to work. Any ideas about what I’m doing wrong?
I found that I can successfully write to the database through the
console with:
rating = Rating.new
rating.rating = 3
rating.save
I can also update the database using forms in my view but I can’t seem
to get it to work with link_to_remote. Any tips on debugging AJAX using
rails would be really helpful as well. Thanks.
I am trying to use link_to_remote to simply add a record to a database
table called “ratings”. I’ve seen some examples of this being done but
can’t seem to get it to work. Any ideas about what I’m doing wrong?
To put it another way, all the experiments you currently do with the
console, you should instead do as test cases. Then they help you avoid
bugs
and develop faster.