Skip to content

Commit

Permalink
minor refactor in the template guide
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaydev authored and fxn committed Jul 23, 2011
1 parent 53f2a56 commit ed90144
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions railties/guides/source/rails_application_templates.textile
Expand Up @@ -11,22 +11,18 @@ endprologue.


h3. Usage h3. Usage


To apply a template, you need to provide the Rails generator with the location of the template you wish to apply, using -m option: To apply a template, you need to provide the Rails generator with the location of the template you wish to apply, using -m option. This can either be path to a file or a URL.


<shell> <shell>
$ rails new blog -m ~/template.rb $ rails new blog -m ~/template.rb
$ rails new blog -m http://example.com/template.rb
</shell> </shell>


It's also possible to apply a template using a URL: You can use the rake task +rails:template+ to apply templates to an existing Rails application. The location of the template needs to be passed in to an environment variable named LOCATION. Again, this can either be path to a file or a URL.

<shell>
$ rails new blog -m https://gist.github.com/755496.txt
</shell>

Alternatively, you can use the rake task +rails:template+ to apply a template to an existing Rails application:


<shell> <shell>
$ rake rails:template LOCATION=~/template.rb $ rake rails:template LOCATION=~/template.rb
$ rake rails:template LOCATION=http://example.com/template.rb
</shell> </shell>


h3. Template API h3. Template API
Expand Down

0 comments on commit ed90144

Please sign in to comment.