Use the host_name field to determine which conference to assign
This commit is contained in:
parent
70a5bbc27a
commit
df4ffebd61
|
@ -12,7 +12,6 @@ class ApplicationController < ActionController::Base
|
||||||
#layout Proc.new { |controller| controller.request.host }
|
#layout Proc.new { |controller| controller.request.host }
|
||||||
layout 'public/application'
|
layout 'public/application'
|
||||||
|
|
||||||
|
|
||||||
def self.default_url_options(options={})
|
def self.default_url_options(options={})
|
||||||
if I18n.locale != I18n.default_locale
|
if I18n.locale != I18n.default_locale
|
||||||
options.merge({locale: I18n.locale})
|
options.merge({locale: I18n.locale})
|
||||||
|
|
|
@ -2,5 +2,9 @@ module Public
|
||||||
class ApplicationController < ::ApplicationController
|
class ApplicationController < ::ApplicationController
|
||||||
include ::CurrentConferenceAssigning
|
include ::CurrentConferenceAssigning
|
||||||
before_filter :require_current_conference!
|
before_filter :require_current_conference!
|
||||||
|
|
||||||
|
def current_conference
|
||||||
|
@current_conference ||= Conference.order(created_at: :desc).find_by(host_name: request.host)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
devise_for :users
|
devise_for :users
|
||||||
|
|
||||||
scope module: :public, constraints: {subdomain: 'cfp'}, conference_id: 1 do
|
scope module: :public do
|
||||||
root to: 'home#index'
|
root to: 'home#index'
|
||||||
resource :personal_profile, path: 'profile'
|
resource :personal_profile, path: 'profile'
|
||||||
resources :events
|
resources :events
|
||||||
|
|
Loading…
Reference in New Issue