route to conference#show for custom domain

This commit is contained in:
shlok007 2017-07-22 12:34:48 +05:30 committed by Shlok Srivastava
parent 1a5aa14e2c
commit 0ac5d18ef2
5 changed files with 30 additions and 6 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 }