Open Shaglock opened 3 days ago
I just realized there was already similar issue in github "Discussions" https://github.com/ElMassimo/js_from_routes/discussions/37, I was searching only issues :( Sorry
Also probably related to https://github.com/ElMassimo/js_from_routes/issues/42
bundle update js_from_routes
.Description 📖
I am using
devise
andomniauth
gems (versions 4.9.4 and 2.1.2) in brand new rails app, I have 3 providers - google, twitter and facebook. The generated paths have incorrect methodsget|post
config/routes.rb
Output of related
rails routes
Generated result
Probably its not related to devise but to the way routes are defined and how this gem handles it. Related code from devise gem https://github.com/heartcombo/devise/blob/72884642f5700439cc96ac560ee19a44af5a2d45/lib/devise/rails/routes.rb#L446C9-L457C1
Basically if the different HTTP methods are mapped to the same controller action this issue will appear. For example,
results in
So my question is, is there anything we can do with it? Maybe the gem could use the
as
option that was added to the route and add method as suffix? So the result would be something likegoogle_oauth2_omniauth_authorize_get
,google_oauth2_omniauth_authorize_post
, or in case oftest
that would betestGet
,testPost
,testPatch
etc...Or maybe there is some option for different exporting for such routes that I missed?
In any case, thanks for the useful gem!