Answer the question
In order to leave comments, you need to log in
Is it possible to use multiple templates for different domains in RoR, but in one project?
Good day!
There is an application on RoR, you need to make sure that the appearance (interface and styles) are different on different domains (but on the same server). Can this be done without making copies of the app just to replace styles and html ?
Answer the question
In order to leave comments, you need to log in
Searching for "rails themes" gave this
https://github.com/chamnap/themes_on_rails
The easiest way is to create separate layouts and show this or that layout depending on the condition:
class ApplicationController < ActionController::Base
layout :fetch_layout
private
def fetch_layout
if request.domain == 'mysite.com'
'mysite'
else
'application'
end
end
end
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question