I currently have a get request that passes through a list of car types. This request directs to a controller action that then renders a js.erb file that displays a modal with all of these car types in a list. However when the list of car types is large, i am getting a 'url is too long error'. I've done some research and discovered that it is better to do this as a post request.
However when i make this change, the modal no longer appears, but instead just a page of the modal html is displayed. I can't seem to render this modal properly with a post request.
I have tried using format: :js in the controller, or using remote: true, with no luck.
Are there any reasons for why it is only rendering the html and not the actual modal itself?
respond_to do |format|
format.js
end
simple_form_for :car, url: cars_path(format: :js), remote: true