Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 31st, 2012  |  syntax: None  |  size: 0.47 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How do I get a rails template to add additional attributes on migration columns?
  2. generate(:scaffold, "Thing title:string")
  3.        
  4. Rails-3.1.0
  5. Ruby-1.9.2-p290
  6.        
  7. $ rails generate model --help
  8. Usage:
  9.   rails generate model NAME [field:type field:type] [options]
  10. [...]
  11.        
  12. def generate(what, *args)
  13.   log :generate, what
  14.   argument = args.map {|arg| arg.to_s }.flatten.join(" ")
  15.  
  16.   in_root { run_ruby_script("script/rails generate #{what} #{argument}", :verbose => false) }
  17. end