Request-URI Too Large Error - Get rid of GET?

百般思念 提交于 2019-12-04 11:10:25
Runthral

It depends on the browser / web server, but the average limit for a URL is 2000 characters. So yes, if you are hitting the limit change it to POST.

This will require changing the form tag:

<%= form_tag('/submit', method: "post", remote: true) do %>

Depending on your current routing, it might also require updating your route: ( since when using resources POST requests by default are routed to the create method in your controller )

match '/submit', to: 'submit#index', via: :post

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!