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 'public/application'
|
||||
|
||||
|
||||
def self.default_url_options(options={})
|
||||
if I18n.locale != I18n.default_locale
|
||||
options.merge({locale: I18n.locale})
|
||||
|
|
|
@ -2,5 +2,9 @@ module Public
|
|||
class ApplicationController < ::ApplicationController
|
||||
include ::CurrentConferenceAssigning
|
||||
before_filter :require_current_conference!
|
||||
|
||||
def current_conference
|
||||
@current_conference ||= Conference.order(created_at: :desc).find_by(host_name: request.host)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
Rails.application.routes.draw do
|
||||
devise_for :users
|
||||
|
||||
scope module: :public, constraints: {subdomain: 'cfp'}, conference_id: 1 do
|
||||
scope module: :public do
|
||||
root to: 'home#index'
|
||||
resource :personal_profile, path: 'profile'
|
||||
resources :events
|
||||
|
|
Loading…
Reference in New Issue