#218 Making Generators in Rails 3
Generators in Rails 3 have been rewritten to use Thor which means the code used to create a generator is quite different. Here you will learn the new way to make generators in Rails 3.
- Download:
- source code
- mp4
- m4v
- webm
- ogv
Just reviewed #216, and found this one. You are unbelievable. Thanks a lot.
Hi Ryan
I just read this "You no longer need to place a minus sign at the end of a ruby interpolation inside an ERb template to remove the trailing carriage return in the HTML output."
http://guides.rails.info/3_0_release_notes.html
Keep the Rails 3 ones coming.
Thanks
Ben
Nice episode.
Wouldn't a better name for "layout.html.erb" be "layout.html.erb.erb"?
Nice screencast, very useful :)
I have one problem, with making generator as a global generator.
Where i must put files ?
Version from Rails 2 "$HOME/.rails/generators" don`t work anymore.
Hey Ryan, great cast as usual. Karol's question above is still open, my Google searches thus far have not turned up any answer. Besides making a plugin, is there a place Rails 3 looks for custom generators outside of a Rails app as it did in Rails 2?
Very cool for some things. Can't forget to try to DRY code out instead of just generating it, though. Good choice of an example though -- redoing my standard layouts each time I start a new project gets frustrating after a while. Thanks!
Does anyone have any tips for testing generators?? It looks to me like test/unit has some helper methods for testing generators, but I haven't been able to find any references or tutorials.
Also - can anyone explain how hook_for is supposed to work?
http://stevehodgkiss.com/posts/testing-rails-3-generators-with-rspec
Testing would make sense if you had business logic. It does not make much sense for generating files.
I know this is old... But it made my day!
I'm having a hard time finding more info on how to template a Controller. I could write a bunch of stuff to set the class name to reflect the generator name (e.g. rails g generator dumb_thing => Controller template with filename dumb_thing.rb and class name of DumbThingController) but this has to have been covered by Rails 3's generator/template support. Can you include a simple Controller in your rails cast next time please? Thanks!
Nice
Terrarium tv app : How many of you stream online movies and looking for a app by you can watch and stream movies than you are in right place. we are gonna discuss about terrarium tv app for android/ios to Download terrarium tv app on pc/windows/mac so read this full guide to know about this terrarium tv app.