Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • A administrate
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 96
    • Issues 96
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 32
    • Merge requests 32
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • thoughtbot, inc.
  • administrate
  • Merge requests
  • !387

Update docs with correct view paths

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Administrator requested to merge gw-view-path into master Jan 08, 2016
  • Overview 0
  • Commits 1
  • Pipelines 0
  • Changes 1

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.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gw-view-path