Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8447397
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:10:22+00:00 2026-06-10T10:10:22+00:00

I manage a few Rails sites that have very similar source code with a

  • 0

I manage a few Rails sites that have very similar source code with a few small differences (most but not all differences reside in the database). I would like each site to have identical base source code with any source code differences residing in custom files that override the base source code. For example, if one site had a photo contest going, that site would have a special view file that the other sites would not have, yet all would have the same default view file (only the one with the contest would be overridden). Would this be a task for Rails Engines? If not (or if there is a better way), how would you go about doing this?

Thanks.

Edit: Here’s another example – one site (out of the three I manage) needs to have special text on a certain page. I want the view for this page on all three sites to remain the same and I do NOT want to have conditional code in the view determining whether or not to show this text. Rather, I’d prefer to have a separate view for the variant site that overrides the default view (MUCH easier to manage differences between sites this way).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:10:24+00:00Added an answer on June 10, 2026 at 10:10 am

    The immediate answer to your question (see below). The longer explaination to your question, http://edgeguides.rubyonrails.org/engines.html#overriding-views. Let me know if you still have questions (engines are a hobby of mine).

    app1
    |- app/views/photo_contests
    |                      |- index.html.erb  # => custom view template #1
    |
    \- Gemfile (gem 'common_engine')
    
    app2
    |- app/views/photo_contests
    |                      |- index.html.erb  # => custom view template #2
    |
    \- Gemfile (gem 'common_engine')
    
    
    common_engine
    |
    |- app/controllers/PhotoContentsControllers.rb
    |                      |- index
    |                      |- show
    |                      |- vote
    |
    |- app/models/photo_contest.rb
    |
    |- app/views/photo_contents
    |                      |-  index.html.erb
    |                      |-  show.html.erb
    |                      |-  vote.html.erb
    |- config/routes.rb
    |- lib/common_engine/engine.rb
    |- lib/common_engine.rb
    \- common_engine.gemspec
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very new to Rails, have managed a few simple projects, but now stepping into
I have written a few lines of code which I think should not compile.
I have quite a few domains that I manage (100+) and I'm getting tired
This question was asked few other times, but I still did not manage to
I have read the Apple documentation regarding Mobile Device Management (MDM) but did not
I have a few camel routes that call an external web service, i need
Situation I have a few single-responsibility Servlets that take a request, do their job,
I'm using Eclipse to write a small Java application that uses WLST to manage
I'm loading a few huge images on my flex/as3 app, but I can't manage
I have a Linode (Ubuntu 9.10, but upgrading not a problem) where I run

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.