Answer the question
In order to leave comments, you need to log in
How to call a method from a controller without a redirect?
There is a code:
= link_to "Start test", "start_new_test", class: "btn btn-primary"
Answer the question
In order to leave comments, you need to log in
As Dima wrote , it's enough just to add remote: true
it. But in the controller, in turn, you need to render the thread, or by default the controller will look for controller_name.html.erb.
In the controller you need to add
If pressing a button still requires some kind of visual reaction, then check out this page rusrails.ru/working-with-javascript-in-rails
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question