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

Admin generator is not completely aware of the user defined model name #780

Closed
joelcuevas opened this Issue Feb 9, 2012 · 4 comments

Comments

Projects
None yet
4 participants
@joelcuevas
Contributor

joelcuevas commented Feb 9, 2012

File: padrino-admin / lib / padrino-admin / generators / admin_app.rb
Lines: 108, 109

There are hardcoded paths admin/views/accounts/_form.#{ext} and admin/controllers/accounts.rb even when the generator is called with, e.g., "-m User". This causes, obviously, a failure. It should be looking for something like admin/controllers/users.rb instead.

C:/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:226:in `binread': No such file or directory - c:/Padrino/admin_testing/admin/views/accounts/_form.haml (Errno::ENOENT)
from C:/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/thor-0.14.6/lib/thor/actions/file_manipulation.rb:226:in `gsub_file'
from C:/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/padrino-admin-0.10.6.c/lib/padrino-admin/generators/admin_app.rb:108:in `create_admin'
...
@nesquena

This comment has been minimized.

Show comment
Hide comment
@nesquena

nesquena Feb 9, 2012

Member

Good catch, we'll have to fix this in an upcoming release! Thanks

Member

nesquena commented Feb 9, 2012

Good catch, we'll have to fix this in an upcoming release! Thanks

@DAddYE DAddYE closed this in 61e54e8 Feb 15, 2012

WaYdotNET pushed a commit to WaYdotNET/padrino-framework that referenced this issue Feb 17, 2012

Merge pull request #788 from joelcuevas/master
Fixes #780 - Admin generator is not completely aware of the user defined model name.
@joelcuevas

This comment has been minimized.

Show comment
Hide comment
@joelcuevas

joelcuevas Apr 16, 2012

Contributor

After a while using the admin generator I discovered that this same issue was affecting other areas of the code. I corrected all the issues that I found and I've been using the generator for a month now without incidences, so I'm requesting a new pull with my code. :)

Contributor

joelcuevas commented Apr 16, 2012

After a while using the admin generator I discovered that this same issue was affecting other areas of the code. I corrected all the issues that I found and I've been using the generator for a month now without incidences, so I'm requesting a new pull with my code. :)

@DAddYE

This comment has been minimized.

Show comment
Hide comment
@DAddYE

DAddYE Apr 25, 2012

Member

Should be finally fixed: 3f7081d, thanks @joelcuevas

Member

DAddYE commented Apr 25, 2012

Should be finally fixed: 3f7081d, thanks @joelcuevas

WaYdotNET pushed a commit to WaYdotNET/padrino-framework that referenced this issue Apr 25, 2012

Merge pull request #832 from joelcuevas/master
Fix #780. Found that some templates wasn't aware of the user-defined model name in admin generator.

WaYdotNET pushed a commit to WaYdotNET/padrino-framework that referenced this issue Apr 25, 2012

@fnordfish

This comment has been minimized.

Show comment
Hide comment
@fnordfish

fnordfish May 14, 2012

Contributor

Sorry folks, there is still a glitch in the session controller template. Which will generate the create action like:
if account = .authenticate(params[:email], params[:password])

See my pull request 846.

Contributor

fnordfish commented May 14, 2012

Sorry folks, there is still a glitch in the session controller template. Which will generate the create action like:
if account = .authenticate(params[:email], params[:password])

See my pull request 846.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment