So, in my rails application, I have a button_to on one of my pages. When I click this button on the page, it goes to the appropriate action and does everything I want, BUT: it uses a GET request. When I look at the chrome console on the network, it shows it with a GET request.
When I first noticed this, I ran the rails server on my laptop, connected to the Internet via wireless, and I connected to it using my ipad (for testing), and the connection was pretty slow, so when the page loaded after clicking for For several seconds, the parameters were displayed in the address bar. I do not want it.
So, this prompted me to do some verification, and, as I said, under the chrome network tab a request for receipt is displayed, and in my routes, when I specify: via => :post , and then go to the page that it breaks. he does not say that the route does not match [GET] /---- . when i delete :via => :post , it works fine. this confirms that with a GET request go to the /---- page when you click button_to .
I tried specifying method = post in button_to , although the rails api says that the default message is.
Can someone give an idea of ββwhy he uses "get" as opposed to "post"? I would really like him to use the post, if at all possible.
source share