Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs with correct view paths #387

Merged
merged 1 commit into from
Jan 20, 2016
Merged

Update docs with correct view paths #387

merged 1 commit into from
Jan 20, 2016

Conversation

c-lliope
Copy link
Contributor

@c-lliope c-lliope commented Jan 8, 2016

Closes #202

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)

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.

Closes #202

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:

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.
@c-lliope c-lliope merged commit 60ce6d6 into master Jan 20, 2016
@c-lliope c-lliope deleted the gw-view-path branch January 20, 2016 01:55
c-lliope added a commit that referenced this pull request Jan 22, 2016
Changes:

```
* [#269] [FEATURE] Add a generator for copying default layout files
* [#328] [FEATURE] Add a generator for copying default sidebar partial
* [#362] [FEATURE] Add a generator for only the dashboard manifest.
  Customizing this manifest before running the `administrate:install` generator
  will change which dashboards get generated.
* [#295] [FEATURE] Add dashboard detection for ActiveRecord::Enum fields.
* [#364] [FEATURE] Improve dashboard generator by explicitly listing out the
  generated `SHOW_PAGE_ATTRIBUTES` array elements.
* [#416] [UI] Add an accessibility label to the search input
* [#411] [UI] Use tabular figures in table cells
* [#409] [UI] Use default system fonts
* [#424] [BUGFIX] Fix a bug where running `rails destroy GENERATOR_NAME`
  would not work for several of the generators
* [#390] [BUGFIX] Fix timestamp deprecation warnings
* [#365] [COMPAT] Remove dependency on `inline_svg`
* [#396] [I18n] Ukrainian
* [#297] [I18n] Italian
* [#307] [I18n] Fix German grammatical errors
* [#363] [DOC] Move documentation into main repository, at the root URL
* [#395] [DOC] Update inline documentation for collection partial
* [#387] [DOC] Fix incorrect path for generators in the docs
```
@c-lliope c-lliope mentioned this pull request Jan 22, 2016
c-lliope added a commit that referenced this pull request Jan 22, 2016
Changes:

```
* [#269] [FEATURE] Add a generator for copying default layout files
* [#328] [FEATURE] Add a generator for copying default sidebar partial
* [#362] [FEATURE] Add a generator for only the dashboard manifest.
  Customizing this manifest before running the `administrate:install` generator
  will change which dashboards get generated.
* [#295] [FEATURE] Add dashboard detection for ActiveRecord::Enum fields.
* [#364] [FEATURE] Improve dashboard generator by explicitly listing out the
  generated `SHOW_PAGE_ATTRIBUTES` array elements.
* [#416] [UI] Add an accessibility label to the search input
* [#411] [UI] Use tabular figures in table cells
* [#409] [UI] Use default system fonts
* [#424] [BUGFIX] Fix a bug where running `rails destroy GENERATOR_NAME`
  would not work for several of the generators
* [#390] [BUGFIX] Fix timestamp deprecation warnings
* [#365] [COMPAT] Remove dependency on `inline_svg`
* [#396] [I18n] Ukrainian
* [#297] [I18n] Italian
* [#307] [I18n] Fix German grammatical errors
* [#363] [DOC] Move documentation into main repository, at the root URL
* [#395] [DOC] Update inline documentation for collection partial
* [#387] [DOC] Fix incorrect path for generators in the docs
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant