I am running into a complicated case using spree. I have a components-based rails app with 3 spree engines or extensions:
my_core: contains spree and auth_spree models + my own extra models
my_api: contains the api for my app (totally different than spree_api)
my_backend: here I want to install spree_backend but use my_core models of corse.
Is there any way to install spree_backend without models? and how would the authentication flow works inside?
In my routes I have:
# config/routes.rb
Rails.application.routes.draw do
constraints :subdomain => 'api' do
mount MyAPI::Engine, at: "/"
end
constraints :subdomain => 'admin' do
mount MyBackend::Engine, at: "/"
end
end
# components/my_backend/config/routes.rb
MyBackend::Engine.routes.draw do
root to: "spree/admin/orders#index"
mount Spree::Core::Engine, :at => '/'
end
Updates 19-06-2015
I finally could lunch the admin page by modifying the engine routes:
# components/my_backend/config/routes.rb
MyBackend::Engine.routes.draw do
root to: "admin/orders#index"
mount Spree::Core::Engine, :at => '/'
end
Moreover, I had to fix many issues with assets. But still facing one issue with routes in spree.js.coffee.erb file
Is there something I am doing wrong? Any suggestions will be very appreciated!!!
I solved this issue if someone need it, by creating a new file spree.js.coffee.erb in my engine vendor directory and overriding the method @mountedAt of that class to: