Rails 3 is very exciting! This is perfect! Thanks so much Ryan.
Zolzaya
This site positively needs a Flattr button! Want an invite?
Before a few days i manage to overwrite the migration template adding collation and encoding info.
I have create a new file here:
"lib/templates/active_record/model/migration.rb" so you may have to adjust the the folder name for the scaffolding to work.
I have found the right folder name for the controller/view scaffolding, but at my village PC so i don't have the right folder name here, sorry ;-). One problem that i have found is that the lis of files that the generator makes is hardcoded. So not an easy way to have an _item.html.erb partial other than to copy and rename the generator inside lib/generators.
Keep your good job Rayan
The customized scaffold template is not used because you require 'rails/generators' at the end of the application.rb file.
Thanks again!
Here are some nice resources/blog posts of almost everything with Rails 3 generators
http://www.viget.com/extend/
Hey Ryan nice video, I learned some more tips about that now.
About replace scaffolds I think the problem is only the path.
I use here for haml -> /lib/generators/haml/scaffold/templates/index.html.haml and other.
I think you need do the same for erb: /lib/generators/erb/scaffold/templates/index.html.erb
You used lib/templates instead of lib/generators
Kind of related to the topic of generators, I've been working on a gem for quick project creation from templates (not just Rails, any kind of project) You can check it out (pun fully intended) on github:
http://github.com/i0n/jumpstart
Jari is right. It is easy to fix. Use
config.generators do |g|
...
g.fallbacks[ :shoulda ] = :test_unit
end
instead
Great work as usual!
Alfredo Ribeiro, I have tried the route lib/generators/erb/scaffold/templates/index.html.erb
for erb and it didn't work.
Great episode. I don't know why, but this one was a stand out for me. I really learned a lot, so thank you.
Hey Ryan,
Yes, it was a bug. When you required rails/generators in config/application.rb, it was being required too early and then Rails::Generators could not copy part of the configuration set in your application.
This was fixed and the guide updated. However, as David Trasbo pointed above, the best solution is to use config.generators.fallbacks. You usually don't want to require "rails/generators" because it would force generators to be loaded in production (for instance).
Sorry for the issue! :)
Nice screencast! I wonder why you never use haml instead of erb. I switched a long time ago and don't regret it at all. It's so much nicer and cleaner to use haml instead of erb. In the latest version of the gem you can even do multiline commands which was a bit awkward to achieve before. Sorry if this is a bit off topic, it just popped into my mind... ;-)
Ryan, I love your screencasts, and they have helped me enormously in getting to grips with Rails more quickly than I otherwise would.
However, I can't help feeling that Rails 3 is still (at least) months away from being a version that can be properly utilised by serious developers. I know your railscasts are meant to be at the forefront of what is best in the ROR community, but clearly (to me) the number of necessary workarounds indicated by your vids - and many others on the same subject (upgrading to Rails 3) - leave me with a no-brainer decision on whether to upgrade production systems to Rails 3 - NFW.
I'm surprised at the flexible usage of Rails 3. It's amazing!
Great screencast Ryan! Thanks!
This inspired me to write a blog post on getting Rails 3, RSpec, and Cucumber all set up and working together:
http://blog.notahat.com/posts/43
Custom generators! cool. This will surely add a new dimension of generators to opensource contribution for rails, like gems and plugins. Could'nt imagine Rails could improve more :)
Great screencast per usual. I've started using my own templates for scaffolding and found it makes life just that much simpler. I was wondering if anyone has tried changing the rails new generator so that each new project creates the same lib/templates directory. Figure this kinda makes your nifty-generators a little outdated.
Cheers.
This didn't work with the non-standard rails3-generators for me, but putting the line
require 'rails/generators'
into a file (named anything) within config/initializers fixed it. I get errors when it tries to created the helpers and stylesheets for some reason, though (error shoulda [not found] it says, though it finds it for the test).
hey buddy,this is one of the best posts that I’ve ever seen; you may include some more ideas in the same theme. I’m still waiting for some interesting thoughts from your side in your next post.
The article written by you very good, I like it very much. I will keep your new article.
<pre>Fantastic write-up you could have composed. I came across the topic worth it to read making with an pleasurable examine.
Below are a few a lot more i consider you'll find intriguing also </pre>
<p><a href="http://www.2hotnsexy.com/Indianapolis/Escort-Agencies/tag/elite-escorts-indianapolis/2/">elite escorts indianapolis</a></p>
<p> <a href="http://www.2hotnsexy.com/Indianapolis/Escort-Agencies/tag/facials/47/">facials</a> </p>
Fantastic write-up you could have composed. I came across the topic worth it to read making with an pleasurable examine.
Below are a few a lot more i consider you'll find intriguing also
<p> <a href="http://www.2hotnsexy.com/Indianapolis/Escort-Agencies/tag/facials/47/">facials</a> </p>
Fantastic write-up you could have composed. I came across the topic worth it to read making with an pleasurable examine.
Below are a few a lot more i consider you'll find intriguing also
This was really useful. Thanks Ryan! Best site is worl. New one rail best way sites in. Great screencast per usual. I've started using my own templates for scaffolding and found it makes life just that much simpler.
I came to your article from another article and am really interested in this learning about this. , I feel strongly about information and love learning more on this. If possible, as you gain expertise, It is extremely helpful for me. would you mind updating your blog with more information?
love converse all star,love yourself.High quality low price.It's fit for you.
I experience some strange behaviours when playing around with this multistep form. Sometimes, when pressing back to change a step, it jumps two steps forward when pressing next afterwards. Somebody else who sees this in his form?
David Heinemeier Hansson..thanks. [url=http://www.icheapwholesale.com]cheap wholesale clothes[/url]
Interesting, but as usual..<a href="http://e-spasibo.ru/article_info.php?articles_id=7">Подарок маме</a>
A hint for anyone stuck trying to override the default model when using the scaffold generator: make a template file in lib/templates/active_record/model/model.rb
Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it. My readers have about the same interets
If possible, as you gain expertise, It is extremely helpful for me. would you mind updating your blog with more information?
the same theme. I’m still waiting for some interesting thoughts from your side in your next post.
Great screencast per usual. I've started using my own templates for scaffolding and found it makes life just that much simpler.
Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it.
Thanks for sharing your article. I really enjoyed it. I put a link to my site to here so other people can read it.
I have found the right folder name for the controller/view scaffolding, but at my village PC so i don't have the right folder name here, sorry ;-).
Hi, good post, and awesome weblog you have here!
What’s this theme you use? Is it customized?
If customized can you please facilitate me the website of the company who designed it for you?
I would apreciate to have him/her do one for me also!
This is really a nice guide for Newbies like me. Thank you.






