1

I am working on multiple projects, which most of them have common controllers and views.

Is there a way to be able to copy all the common code in a script or something?

Any ideas on this

Thanks

Clay
  • 149
  • 3
  • 11

1 Answers1

1

You're looking for a rails engine, which is a gem you can use in other projects. The gem provides controllers, views, etc. Devise is maybe one of the best examples of this, providing an authentication framework.

First promising hit on Google for how to make one was this, but I'm sure you can find more.

dpassage
  • 5,423
  • 3
  • 25
  • 53
  • Thanks, I thought that it might be a gem route. However will this be a private gem as do want the code to available to the public? I have my own Authentication Etc build from scratch! – Clay Oct 18 '12 at 09:13
  • "how to make a private gem" is another question entirely. :) If you're keeping your private gem in a local git repository, you can reference it that way from the `Gemfile`. http://stackoverflow.com/questions/4840680/how-can-i-specify-a-gem-to-pull-from-a-private-github-repository is sort of about that. – dpassage Oct 18 '12 at 23:11