Please read for an updated status on RailsCasts:
Learn more or hide this
Just reviewed #216, and found this one. You are unbelievable. Thanks a lot.
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."
Keep the Rails 3 ones coming.
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?
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!
First sign in through GitHub to post a comment.