views:

205

answers:

5
+3  Q: 

Rails Templates?

I am starting to learn Ruby on Rails. I have an application in mind that I would like to create, but I know I'm going to have to repeat a lot of the things that have already been done a million times (such as user authentication, etc).

I just found out about rails templates. From what I understand, you can use one of these templates to create a new rails application and set up a lot of the basics. Where can I find some of the most popular templates, and should I use one of them?

+1  A: 

Jeremy McAnally maintains a diverse collection here: http://github.com/jm/rails-templates/

I don't think there are any silver bullets, but they display a lot of techniques that templates allow.

Ben
A: 

Try to search on github, there are really a lot of cool stuff. http://github.com/search?langOverride=&q=rails-templates&repo=&start_value=1&type=Repositories

If you search a example of authentication try to search a authlogic-example on github.

Sebastian
+1  A: 

Rails Kits may also fit your needs, even though they're not actually Templates:

http://railskits.com/available-kits/

Jeff Perrin
Thanks Jeff....I'd totally forgotten about this site.
btelles
A: 

Hi there,

There are several ways to extend a Rails application and/or start one off. You've mentioned just one of the big four. The others are:

  • Plugins
  • Engines
  • Gems
  • Templates

Templates are generally used to start out an application, but if designed correctly, you can use them to extend one. For example, many stock templates out there help setup a code repository, install a few plugins/gems, and perhaps fix up the layout a little so you don't have to. Of course, you'll usually do most of these when you first start out a project. At our company (3 developers) I created a template that sets up our dev and production environments, repositories, project tracking. Here's my favorite stock template: http://github.com/lhoeg/app_lego/network (The original hasn't done much work on it in a while, and I believe this is the best fork out there now)

Plugins and Gems are more or less becoming synonymous and there's little reason any more for people to create plugins, as gems are the more Ruby-standard way to package functionality. Generally you'll use plugins to add bits of very specific functionality to your application. This can range from adding user authentication, to calendaring, to adding locations and mapping to your app. Most plugins that I've used extend the ActiveRecord or database part of the application. If the plugin comes with views, controllers, or modifies your database tables it'll usually come with a generator. A good example is the Restful Authentication plugin's generator. A relatively good list of http://agilewebdevelopment.com/

Engines are the kings of modularity. They usually provide a lot more functionality than plugins. Whereas plugins and gems generally extend Rails itself, Engines are intent on extending YOUR application by adding a full set of views, controllers and models. Thus engines are entire Rails applications packaged into a neat little box that you can just plop into your app and instantly add a bunch of functionality. There's also an Engines directory at http://agilewebdevelopment.com/ but as you'll see, there aren't very many.

Hope this helps!

Berns

btelles
A: 

Ryan has some Rails templates: http://github.com/ryanb/rails-templates

It seems Jeremy's repository gave me a 404 when I tried it.

Pie