Module: Decidim::FeaturePathHelper

Defined in:
app/helpers/decidim/feature_path_helper.rb

Overview

A helper to get the root path for a feature.

Instance Method Summary collapse

Instance Method Details

#main_feature_path(feature) ⇒ Object

Returns the defined root path for a given feature.

feature - the Feature we want to find the root path for.

Returns a url.



11
12
13
14
# File 'app/helpers/decidim/feature_path_helper.rb', line 11

def main_feature_path(feature)
  current_params = try(:params) || {}
  EngineRouter.main_proxy(feature).root_path(locale: current_params[:locale])
end

#manage_feature_path(feature) ⇒ Object

Returns the defined admin root path for a given feature.

feature - the Feature we want to find the root path for.

Returns a url.



21
22
23
24
# File 'app/helpers/decidim/feature_path_helper.rb', line 21

def manage_feature_path(feature)
  current_params = try(:params) || {}
  EngineRouter.admin_proxy(feature).root_path(locale: current_params[:locale])
end