Closed aldefouw closed 6 years ago
@arvindvyas
https://github.com/aldefouw/Country-State-Select/commit/a349d4ff1f0e149f7982f371fc593e88cf4fb840
Adding the above code to the routes.rb file would allow the routes to be mountable. I created a version on my development branch so that I can use this for the application I am using.
You'd have to be careful about releasing this one because it would break unless people added this line:
mount CountryStateSelect::Rails::Engine, at: "/"
(The above line is added to routes.rb in your app that users the gem.)
I will look this in this weekend
Thanks @arvindvyas . Nice work on the gem, too. The newest version looks really good.
On one of the applications that I used this gem in, I had a route matcher at the end of the routes.rb file.
Something like this:
match '*unmatched_route', to: 'application#not_found', :via => :all
All was fine and dandy, but suddenly the POST routes for this gem (which are crucial to the gem) stopped working.
You know why?
Because of the order that the routes were configured in the manifest, #find_states and #find_cities was no longer routing to the CscsController.
They were now routing to the ApplicationController#not_found.
@arvindvyas - See my post below for how I fixed this ....