hobo generate controller fails when generating routes and doesn't generate command stubs
Reported by Don Ziesig | January 20th, 2011 @ 02:45 PM | in Hobo 1.4
Issue the command:
hobo generate controller option show_keys hide_keys
observe:
Hobo Command Line Interface 1.3.0.pre25
/usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:113:in `constantize': uninitialized constant Option (NameError)
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:112:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:112:in `constantize'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/string/inflections.rb:43:in `constantize'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/hobo/controller/model.rb:86:in `model'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/hobo/controller/model.rb:299:in `available_auto_write_actions'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/hobo/controller/model.rb:287:in `available_auto_actions'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/hobo/controller/model.rb:128:in `auto_actions'
from /home/dziesig/Desktop/Hobo1.3/locale_problem_demo/app/controllers/option_controller.rb:5
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:113:in `constantize'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:112:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/inflector/methods.rb:112:in `constantize'
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/core_ext/string/inflections.rb:43:in `constantize'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/hobo/controller/model.rb:61:in `all_controllers'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/hobo/controller/model.rb:57:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/hobo/controller/model.rb:57:in `all_controllers'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/generators/hobo/routes/routes_generator.rb:32:in `controllers_for'
from (erb):11:in `template'
from (erb):6:in `each'
from (erb):6:in `template'
from (eval):1:in `template'
from /usr/local/lib/ruby/gems/1.8/gems/hobo-1.3.0.pre25/lib/generators/hobo/routes/routes_generator.rb:21:in `generate_routes'
snip ...
The controller file is generated, but without stubs for show_keys and hide_keys like the Rails controller generator used to do. (I can live without them)
The config/routes.rb file has not been touched (since I did a migration yesterday). This is more inconvenient since the routes.rb file has been an exercise in programming to a moving target for the last four years or so. I've given up trying to un-learn, then re-learn how to update it until it hopefully stabilizes.
Comments and changes to this ticket
-
Domizio Demichelis March 10th, 2011 @ 09:39 PM
- State changed from new to open
- Milestone set to Hobo 1.3 (Rails 3)
- Milestone order changed from 197944 to 0
"The config/routes.rb file has not been touched (since I did a migration yesterday)."
That is normal, since the auto-generated routes (in config/hobo_routes.rb) should include it.
Then you should probably have a model already created with the same name, or use the "hobo:resource" generator which creates the model first, and adds the controller after. If you launch an app with a hobo_model_controller that doesn't have any model the error seems quite normal.
Anyway, the generator should also be refactoried in order to use the rails "controller" generator and inject into that file the hobo bits, so it will preserve the option eventually passed to that generator (which are just ignored now).
If the stubs are important, you can use the rails controller generator, pass the options, then add manually the hobo statements.
-
Domizio Demichelis March 27th, 2011 @ 01:25 PM
- State changed from open to hold
-
Domizio Demichelis April 15th, 2011 @ 05:09 PM
- State changed from hold to new
- Milestone changed from Hobo 1.3 (Rails 3) to Hobo 1.4
- Milestone order changed from 10 to 0
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป