This is a great way to contribute to the rails community, In Chile we were talking lately about how to give something to the community for all the things we get from them. Thanks, we have another way.
another great railscast! thanks a lot and keep up the good work!
great!
Great!!!
I'm stuck using Windoze for development and so I tried unzipping your app_layout into C:\documents and settings\myusername\.rails\generators\app_layout and it doesn't find it :(
Any ideas on how to do this in Windoze?
Figured it out. For some reason ruby isn't using \ but is using / and so as soon as I changed USERPROFILE to use / it worked :)
So how would one go about adding their own commands to Manifest so that they would rewind properly and available in the record block so I could do m.mycmd?
Another champion episode.
I've written generators before but I don't think I'd ever thought to use them for simple tasks like this.
So now, I have a database.yml generator to include my dev mysql.sock details, local password etc. So thanks for the inspiration.
@Brent, good question. I recommend checking out the Rails source code to see how this is done. Go through the different ruby scripts at the URL below (particularly base.rb and commands.rb):
http://svn.rubyonrails.org/rails/trunk/railties/lib/rails_generator/
Great episode. That was needed :).
For learning I tried to improve it. Added --no-css option and default file name.
http://pastie.caboo.se/79207
Actually i want to add <title><% yield :title %></title> too. It was on one episode by Ryan before. Maybe someone can throw a link, how to modify some other file..
@InMan, great job! I like what you've done there! It's an excellent example of how to add options to a generator.
You may want to override the "banner" method to provide a short usage description.
http://pastie.caboo.se/79278
Actually attr_accessor isn't needed for views :).
Banner removes just first line actually. (atleast in edge).
But maybe I'm wrong. Haven't tested it yet .
Hi Ryan, I've recently discovered your site and can I just say what a great asset it is. Keep up the good work and apologies in advance for systematically downloading episode after episode!
Note: in edge rails you can now store generators within RubyGems' /generators or /rails_generators folder. Similarly, plugins you can now store generators within /rails_generators as well as the existing /generators folder support.
I'm having a bit of trouble. I'm storing my generator in the plugins dir. C:\projects\cap\vendor\plugins\app_layout\generators\app_layout
I'm getting the following when I try and run ruby script/generate app_layout.
c:/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/rails_generator/base.rb:122:in `manifest': No manifest for 'app_layout' generator. (NotImplementedError)
Any Suggestions?
@rudy, does your app layout generator have a "manifest" method?
This generator cast was great. I'd been waiting for something to be broadcast so clearly regarding generators. Thanks a lot Ryan. For everyone else, I am trying something a little different and ran into some trouble. Would people mind taking a look at my post at http://railsforum.com/viewtopic.php?id=7711 and helping a brother out?
Thanks,
Bryce
manifest not mainfest, derrr. Creating this generator is the sickest thing I've done yet with rails. Thanks Ryan. Railscasts.com is the bomb!!!!!!!
Always wanted to do something like this with generator. This screencast is great. Thanks Ryan.
Ryan, thanks so much - I'm glad you're doing 1 a week now (though I'd happily still watch and absorb 3), but it's a helluvalotof work.. If you ever decide to make full length screencasts, I'm sure people would be interested.
great stuff, thanks as always.
NEED help:
My group are working on rails IDE and we're in the wizard part now and we're trying to generate the Rails skeleton and we looked in the rubygems and found in
gems/1.8/gems/rails-1.2.2/lib/rails_generator/generators/applications/app/app_generator.rb
what does it do, does it generates rails skeleton? are there any other scripts we need to execute as well?
plz email me at hisham86@aucegypt.edu
@hhifnawi, this won't generate the full rails skeleton, just a couple files. You should use the "rails" command to generate a full new Rails app. If you still have problems I recommend posting on railsforum.com.
For anyone interested in Generators for other development areas outside of Rails, check out http://rubigen.rubyforge.org
Thanks so much Ryan!
Only constructive-criticism that I have regards the down-time in your screencasts. In this episode in particular, there were a couple REALLY long pauses when nothing complex was happening, and then no pauses when a couple command line programs were run in rapid succession. More consistent, medium-length pauses would be my only suggestion.
Thanks again though, I'm REALLY appreciating these screencasts =).
--Ben
Disregard my above comment. I didn't have the right codec and thus your movies had no sound. I just assumed this was intentional.
I'm kind of shocked that I was totally able to follow along without sound. That's a testament to the clarity of both your screencasts and ruby!
--Ben
Very useful episode. Thanks lot.
By means of analysis, our synthetic judgements have lying before them the noumena.
Great screencast! I was wondering how you would package this generator for use by other developers? Would you create a gem out of it, or a plugin somehow?




