Search code examples
ruby-on-rails-3scaffolding

$ rails generate scaffold * <-what's available to go here, and where can i find it?


so, finding tutorials around the internet provides some of the different types of scaffold available, like:

$ rails generate scaffold Post

$ rails generate scaffold Club

(Answered)1)where can i find a list of the scaffolds available to a standard rails 3 install? possibly with descriptions/screenshots?

(Answered)2)is there a recommended place for community provided scaffolds?

3)what data types can i use for the variables created with scaffolding? for instance, is there a date datatype? float? any ruby datatype?

4)where do i go to find this documentation? i've been searching for info on scaffolding w/o much success, what should i be looking for?


Solution

  • The stuff that goes after scaffold is the name of the model you want to create and optionally its properties. The rails scaffold generator will then create a Model class, Migration, Controller, basic Views and Route entry. So in your two examples it will create scaffolding for a model called Post and another one for a model called Club. You can name these whatever you want e.g.

    rails generate scaffold MyModel.

    Best resource to start is the getting started guide: http://guides.rubyonrails.org/getting_started.html