Ok, so I just started digging into template files using the command
rails mynewprojectname -m templatescript.rb
and it's really, really awesome 8)
What I want to do is something like this in my script -
generate(:scaffold, "user name:string")
rake("db:migrate")
# add some code into the scaffold generate model and controller here!
Essentially, I would like my template script to populate my scaffold
generated files with some default code so I don't have to type the
same things over and over again. Make sense? As an example, by the
time my template is done, it'd be nice to have a bunch of models up
and running with all their associations set up.
From what I've read about templates, it seems like this should be
feasible, but all i've seen so far is some template snippets for
extending ruby's object class to add some methods like not_nil?, which
is great, but not quite what I'm looking for :)
Thanks for taking the time to look at this!
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No comments:
Post a Comment