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

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

Closed
joelcuevas opened this issue Feb 9, 2012 · 4 comments
Closed
Milestone

Comments

@joelcuevas
Copy link
Contributor

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
Copy link
Member

nesquena commented Feb 9, 2012

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

@DAddYE DAddYE closed this as completed in 61e54e8 Feb 15, 2012
WaYdotNET pushed a commit to WaYdotNET/padrino-framework that referenced this issue Feb 17, 2012
Fixes padrino#780 - Admin generator is not completely aware of the user defined model name.
@joelcuevas
Copy link
Contributor Author

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
Copy link
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
Fix padrino#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
Copy link
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.

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

No branches or pull requests

4 participants