I would love to use Doorkeeper in a Rails Engine with isolate_namespace enabled, but I'm discovering that there are some blockers to making that happen. Opening this ticket to track them and discuss possible fixes.
ruby
<%= form_tag oauth_authorization_path, :method => :post do %>
It works if given the engine routing helper:
ruby
<%= form_tag my_engine.oauth_authorization_path, :method => :post do %>
So either the views need to account for a routing helper, or we need to change what context they run in. Devise somehow doesn't use the helper and their paths still work. Not sure how they are achieving that.
Doorkeeper::ApplicationController inherits from. something like:ruby
Doorkeeper.configure do
base_controller 'MyEngine::ApplicationController'
end
Simple workaround for that issue:
config/initializers/doorkeeper.rb: Doorkeeper::ApplicationController.send(:include, YourEngine::Engine.routes.url_helpers)require 'dookeeper' in lib/your_engine.rbmodule YourEngine located in lib/your_engine.rb like that:module YourEngine
Doorkeeper = ::Doorkeeper
end
@iangreenleaf did you solve your issue? If so, how? Does the previous comment address the issue? Thanks for your input.
EDIT: Another workaround from @iangreenleaf: https://github.com/doorkeeper-gem/doorkeeper/issues/328#issuecomment-34019343
@tute no, I ended up changing the architecture and not using Doorkeeper in an engine, so I didn't make progress beyond my initial spate of workarounds.
Closing for now then. Thanks!
Most helpful comment
Simple workaround for that issue:
config/initializers/doorkeeper.rb:Doorkeeper::ApplicationController.send(:include, YourEngine::Engine.routes.url_helpers)require 'dookeeper'inlib/your_engine.rbmodule YourEnginelocated inlib/your_engine.rblike that: