route to conference#show for custom domain
This commit is contained in:
parent
1a5aa14e2c
commit
0ac5d18ef2
5 changed files with 30 additions and 6 deletions
6
config/initializers/domain_constraint.rb
Normal file
6
config/initializers/domain_constraint.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
class DomainConstraint
|
||||
def self.matches?(request)
|
||||
@domains = Conference.pluck(:custom_domain).compact
|
||||
@domains.include?(request.domain)
|
||||
end
|
||||
end
|
||||
|
|
@ -1,5 +1,9 @@
|
|||
Osem::Application.routes.draw do
|
||||
|
||||
constraints DomainConstraint do
|
||||
get '/', to: 'conferences#show'
|
||||
end
|
||||
|
||||
if ENV['OSEM_ICHAIN_ENABLED'] == 'true'
|
||||
devise_for :users, controllers: { registrations: :registrations }
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue