Forum: Ruby on Rails The "rails generate" command

Posted by Jason Hsu, Android developer (Guest)
on 2013-02-13 19:04
(Received via mailing list)
I understand the "rails generate" command generates the files needed for 
a
general type of app.  The types of apps include scaffold, model,
controller, and others.

What are all the options, and what do they all mean?
Posted by Robert Walker (robert4723)
on 2013-02-14 08:23
Jason Hsu, Android developer wrote in post #1096722:
> I understand the "rails generate" command generates the files needed for
> a
> general type of app.  The types of apps include scaffold, model,
> controller, and others.
>
> What are all the options, and what do they all mean?

The rails generate ("rails g" for short) is used to generate lots of 
different things. Not just standard rails models, controllers, views, 
etc. It is a mechanism that can also be used by gems, rails engines, or 
even custom generators that you write yourself.

I could try to explain the standard rails generators... or you could 
just read the rails guides.

http://guides.rubyonrails.org/getting_started.html...

The above shows the used of rails generate scaffold, but if you scan 
through the "Getting Started with Rails" guide it shows how to use the 
generators to generate the individual parts of a Rails app.

Judging from your question this guide is where you need to start.
Posted by Serguei Cambour (javix)
on 2013-02-14 10:04
(Received via mailing list)
On Wednesday, 13 February 2013 19:02:40 UTC+1, Jason Hsu, Android 
developer
wrote:
>
> I understand the "rails generate" command generates the files needed for a
> general type of app.  The types of apps include scaffold, model,
> controller, and others.
>
> What are all the options, and what do they all mean?
>

You can also see at the same guide the section on CLI use:
http://guides.rubyonrails.org/command_line.html
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.