Created by: gracewashere
Closes #202 (closed)
Problem:
The documentation states that views will be generated in the app/views/administrate/
directory, but they are actually generated in app/views/admin/
.
Solution:
(as stated in #202 (closed))
In fact, both paths work correctly for overriding views.
Rails looks up views based on the inheritance tree of your controllers. In this case, our inheritance tree looks like:
Administrate::ApplicationController
Admin::ApplicationController
Admin::CustomersController # base level
... so Rails will look for views in:
app/views/admin/customers
,
THEN app/views/admin/application
, THEN
app/views/administrate/application
.
In the future, we'd like to support multiple admin dashboards in the same application, by nesting them under different namespaces (e.g. app/views/admin
and app/views/super_admin
). In that case, views under app/views/administrate
would apply to all of the admin dashboards. Views under app/views/admin
would only apply to the dashboard at the /admin
route, and wouldn't affect the dashboard at /super_admin
.
Because of this, we'd prefer to keep the generated views in /admin
. We'll keep the current implementation, and update the documentation.