You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

41 lines
700 B

class SiteController < ApplicationController
before_action :set_locale
helper_method :root_node
def index
@node = root_node
not_found and return unless @node
render(template: "site/#{@node.template}")
end
def facts
@node = root_node&.children&.facts&.first
end
def intro
@node = root_node&.children&.intro&.first
end
def stage
@node = root_node&.children&.stage&.first
end
private
def root_node
@root_node ||= Node.roots.viewable.first
end
def url_from_param
return "" unless params[:url]
# return File.join('', params[:url]) if I18n.default_locale == I18n.locale
File.join("", I18n.locale.to_s, params[:url])
end
end