Sha256: 815999dda520be690d39a5693b5a4e7f93d07800963ecc37882c83c7535b78a3
Contents?: true
Size: 1.14 KB
Versions: 14
Compression:
Stored size: 1.14 KB
Contents
# frozen_string_literal: true module Decidim # A helper to get the root path for a component. module ComponentPathHelper # Returns the defined root path for a given component. # # component - the Component we want to find the root path for. # # Returns a relative url. def main_component_path(component) current_params = try(:params) || {} EngineRouter.main_proxy(component).root_path(locale: current_params[:locale]) end # Returns the defined root url for a given component. # # component - the Component we want to find the root path for. # # Returns an absolute url. def main_component_url(component) current_params = try(:params) || {} EngineRouter.main_proxy(component).root_url(locale: current_params[:locale]) end # Returns the defined admin root path for a given component. # # component - the Component we want to find the root path for. # # Returns a relative url. def manage_component_path(component) current_params = try(:params) || {} EngineRouter.admin_proxy(component).root_path(locale: current_params[:locale]) end end end
Version data entries
14 entries across 14 versions & 1 rubygems