Answer the question
In order to leave comments, you need to log in
How to write information to the ruby on rails database when clicking on a link?
How, when clicking on a link, take information from two passed variables and write it to the database?
Answer the question
In order to leave comments, you need to log in
Option one. You can write link_to with additional parameters
When clicked, a call will be made to the method that has the corresponding method and name, plus there will be two variables in the params hash: variable1 and variable2.
Option two. Use javascript. In the simplest version, you can use jQuery
$.ajax({
url: 'target_url',
method: 'PUT',
data: {variable1: value1, variable2: value2}
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question