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

When installed to custom namespace, view generators keep using "/admin" #1632

Closed
inem opened this issue May 1, 2020 · 2 comments
Closed
Labels
feature new functionality that’s not yet implemented install initial setup, first-run experience, generators namespacing models with a namespace

Comments

@inem
Copy link
Contributor

inem commented May 1, 2020

I am supporting project where administrate plugged to "console" namespace instead of "admin".

Problem

Every time I generate custom views in this project, they are generated into the default folder

rails generate administrate:views:index Modelname
      create  app/views/admin/modelnames/index.html.erb
      create  app/views/admin/modelnames/_collection.html.erb

Potential solutions

  1. Provide custom setting during installation, where custom namespace gets remembered, and used when you run generators

  2. Support "--namespace=console" option for view generators the same way it works during installation:

"rails generate administrate:views:index Modelname --namespace=console"

Versions

rails (6.0.2)
administrate (0.12.0)

@inem inem added the bug breakages in functionality that is implemented label May 1, 2020
@nickcharlton nickcharlton added install initial setup, first-run experience, generators namespacing models with a namespace labels May 1, 2020
@nickcharlton
Copy link
Member

I'd be keen on option 2 being the right way here. Do you think you'd be able to open a PR to do that?

Another thought I have here is: can we detect the namespace we're using and default to that?

pablobm pushed a commit that referenced this issue Dec 3, 2020
Resolves issue [1632](#1632) 
Makes `rails generate administrate:views:index Modelname --namespace=<Namespace>` possible:

```
create  app/views/<namespace>/modelnames/index.html.erb
create  app/views/<namespace>/modelnames/_collection.html.erb
```
KingTiger001 added a commit to KingTiger001/admin-Rails-project that referenced this issue Jan 15, 2023
Resolves issue [1632](thoughtbot/administrate#1632) 
Makes `rails generate administrate:views:index Modelname --namespace=<Namespace>` possible:

```
create  app/views/<namespace>/modelnames/index.html.erb
create  app/views/<namespace>/modelnames/_collection.html.erb
```
@pablobm pablobm added feature new functionality that’s not yet implemented and removed bug breakages in functionality that is implemented labels Apr 5, 2023
@pablobm
Copy link
Collaborator

pablobm commented Apr 5, 2023

Fixed by #1832

@pablobm pablobm closed this as completed Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature new functionality that’s not yet implemented install initial setup, first-run experience, generators namespacing models with a namespace
Projects
None yet
Development

No branches or pull requests

3 participants