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 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