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

Unable to set a path when generating admin #854

Closed
Fiaxhs opened this issue May 27, 2012 · 15 comments
Closed

Unable to set a path when generating admin #854

Fiaxhs opened this issue May 27, 2012 · 15 comments
Labels
Milestone

Comments

@Fiaxhs
Copy link
Contributor

Fiaxhs commented May 27, 2012

With padrino-admin-0.10.6
If I try to use the --root or -r option when generating admin, an error message appears

$ padrino g admin --root=plop
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
$ padrino g admin -r plop
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)

if I try without this option, generation goes fine.

@DAddYE
Copy link
Member

DAddYE commented Jun 11, 2012

*nix or windows?

@Fiaxhs
Copy link
Contributor Author

Fiaxhs commented Jun 11, 2012

*nix, sorry I forgot to mention that.

@DAddYE
Copy link
Member

DAddYE commented Jun 11, 2012

pretty strange it works on my env very well. Can you try with --root=./plop ?

@Fiaxhs
Copy link
Contributor Author

Fiaxhs commented Jun 15, 2012

Same thing.

I'm running Ubuntu Server 12.04 LTS on a VirtualBox machine.
Do you need more specifications ?

@dariocravero
Copy link

I think it has something to do with the -r/--root of the admin breaking something and self.destination_root on create_admin in padrino-admin/lib/padrino-admin/generators/admin_app.rb. I'm checking. The -r alias seems to be colliding with the same alias on the cli for some bizarre reason. Will look into it better tomorrow.

@Ortuna
Copy link
Member

Ortuna commented Feb 22, 2013

In cli.rb the --root option is being used to load the config/boot.rb file. If another --root is specified, the load_boot method will require 'padrino-core/support_lite'.

Trouble is that if support_lite is loaded then this line isn't executed which adds the padrino-admin generator into Padrino::Generators.load_paths.

So, adding the --root option changes load paths.

I could see how this was the desired behavior.

e.g:

sumeetsingh@pwr:~/Desktop/tmp/public()$ bundle exec padrino g
Please specify generator to use (project, app, mailer, controller, model, migration, plugin)
sumeetsingh@pwr:~/Desktop/tmp/public()$ bundle exec padrino g --root=..
Please specify generator to use (project, app, mailer, controller, model, migration, plugin, admin, admin_page)

Where '--root' points to the padrino project root, but the verbiage is confusing:

Options:
  -r, [--root=ROOT]  # The root destination

Since padrino loads 'light' version of padrino-core if it can't find the path to config/boot.rb

Don't know what the solution is but, this might get someone further in debugging. I'll also take another look when I have some time. but a few things should be cleared up:

what does the --root option point to? The root destination or the app it seems to be used in both ways and interchanged.

@nesquena
Copy link
Member

OK, this is a valid issue and question. Moving to 0.11.1 since I want to release imminently.

@dariocravero
Copy link

A funny note on this issue is that tests didn't catch it because we don't go through the CLI but directly to the generator!

Would this option be there to change the place where the admin is created? I.e., if I'm setting --root another-admin should it create a folder called another-admin in my project's root? Is that the expected behaviour?

I'm in the middle of reviewing the admin's generators because I'm refactoring it to generate a namespaced admin and it wouldn't hurt me to correct this behaviour, I just need to know what's expected from it.

I also have some doubts with the usage of the -a option in the admin. See this. I'll be reusing it for another purpose now: set the app's location so that we know where to take the namespace from.

@dariocravero
Copy link

@padrino/core-members any thoughts on this?

@skade
Copy link
Contributor

skade commented Mar 12, 2013

I think allowing the root to be changed makes sense. It should generate an admin with another folder name.

@dariocravero
Copy link

Great @skade, I think that too... I will implement it then. What about -a?

@j15e
Copy link
Contributor

j15e commented Apr 25, 2013

+1

I ran into this issue too (I modified the app name in the source of padrino to run the generator...)

You should implement the app + model options, there only a few line missing from what I can see, it's almost done!

@gbouthenot
Copy link

Padrino release 0.11.4 still has those problems:
padrino generate admin:
--root option does not work.
--app option is not implemented

Is there any other way to have the admin page elsewhere than /admin ? I would like to have it in /backoffice or /backoffice/admin (changed mount point is not sufficent, there are many path still refering to "/admin".

bolshakov pushed a commit to bolshakov/padrino-framework that referenced this issue Nov 7, 2013
bit better. Also disabled `-a` since it wasn't really doing anything and
left a few notes to implement them. Please, see the conversation at:
padrino#854 (comment)
I don't think this should be a blocker to release 0.11.0 and the rest of
the admin needs to get there in time!..

I also added some tests and refactored existing ones so they make sense.
A few need to be implemented though. Tests are now (almost) in mini test format - moving them slowly away from shoulda/mocka.
bolshakov pushed a commit to bolshakov/padrino-framework that referenced this issue Nov 7, 2013
…into super-admin

* 'super-admin' of github.com:WaYdotNET/padrino-framework:
  Refactored the admin generators to support namespaced apps and to read a bit better. Also disabled `-a` since it wasn't really doing anything and left a few notes to implement them. Please, see the conversation at: padrino#854 (comment) I don't think this should be a blocker to release 0.11.0 and the rest of the admin needs to get there in time!..
@ujifgc
Copy link
Member

ujifgc commented Jan 3, 2014

6d51246 improved relative awareness of admin

@ujifgc ujifgc closed this as completed in d766737 Jan 3, 2014
@ujifgc
Copy link
Member

ujifgc commented Jan 3, 2014

Please use bundle exec padrino g admin -a master to generate admin app named Master and mounted to /master.

Ortuna pushed a commit to Ortuna/padrino-framework that referenced this issue Jan 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants