2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/seiten/routes_helper.rb', line 2
def seiten(*resources)
options = resources.
options[:to] ||= 'seiten/pages#show'
resources.each do |resource|
resource_options = options.dup
resource_options[:as] ||= resource == :application ? :seiten_page : "seiten_#{resource}_page"
resource_options[:defaults] ||= {}
resource_options[:defaults][:navigation_id] = resource.to_s unless resource == :application
resource_options[:defaults][:slug] = ''
resource_options[:constraints] ||= ->(req) { req.path.exclude? 'rails/active_storage' }
get '(*slug)', resource_options
end
end
|