sebastiangeiger
sebastiangeiger

Reputation: 3416

Best way to create a basic reusable rails application

I find myself writing the same things over and over again when starting a new Rails application.

Most of them are experiments just a little beyond the prototype stage, "minimum viable products" if you want to call them that.

They all have in common that there is some kind of usermodel, a form for signup and login, sending emails to registered user to activate accounts... you get the idea. It would be nice to have some kind of basic application that already has such capabilities. Unfortunately the problem is not generic enough for a gem, which leaves me with the following options:

  1. Write a basic application, put it somewhere and then copy it over when starting a new project. This feels dirty!
  2. Use Rails generators to create the usermodel and pull in the gems I am using. I haven't written a generator yet but looking through the documentation and recalling where I saw generators in action, I feel like my problem is slightly too big for generators.
  3. Some other way I haven't thought of...

What I am basically looking for is advice from someone who had the same problem or knows generators better than I do which of the options are more feasible. At the current state I would probably go with the first option and then try to turn it into a generator once I have something working.

Upvotes: 0

Views: 603

Answers (2)

Mark Locklear
Mark Locklear

Reputation: 5325

Sounds like application templates might be a solution to your problem. Check out http://edgeguides.rubyonrails.org/rails_application_templates.html for a general overview.

Upvotes: 3

Glockstock
Glockstock

Reputation: 178

I've been in a similar situation a few times with my Rails projects.

I've found that ActiveAdmin is a solid administrator platform, if you're willing to sacrifice some customizability. For regular user login, you can use Devise (which ActiveAdmin uses as well), and all of your user problems should be solved.

If you use these, I would recommend you check out the RailsCasts on the topic.

Good luck!

Upvotes: 1

Related Questions