route to conference#show for custom domain

This commit is contained in:
shlok007 2017-07-22 12:34:48 +05:30
parent edd0024a17
commit 3e7d6e4b04
5 changed files with 26 additions and 3 deletions

View file

@ -9,10 +9,17 @@ class ConferencesController < ApplicationController
@antiquated = @conferences - @current
end
def show; end
def show
# have to change "localhost" to ENV['OSEM_HOSTNAME'] in production
check_custom_domain if request.host != 'localhost'
end
private
def check_custom_domain
@conference = @conference.custom_domain.present? ? Conference.find_by(custom_domain: request.domain) : @conference
end
def respond_to_options
respond_to do |format|
format.html { head :ok }