So in Rails3 Engines come with their own models/controllers/views and of course routes. Now the question is: How do you ensure that Engine routes will be loaded before (or a
I'm not an expert, but I was playing with sferik/rails_admin yesterday when I came across their routing solution. With their rails_admin:install
rake task, they directly modify your config/routes.rb
file by adding mount RailsAdmin::Engine => '/admin', :as => 'rails_admin'
at the beginning of the file so they are sure their routes always have the highest priority. That mount
method refers to their own routes.rb :
RailsAdmin::Engine.routes.draw do
# Prefix route urls with "admin" and route names with "rails_admin_"
scope "history", :as => "history" do
controller "history" do
[...]
end
end
end
Could this be your solution?