Module: Projects::TopicsHelper
- Defined in:
- app/helpers/projects/topics_helper.rb
Instance Method Summary collapse
-
#topic_explore_projects_cleaned_path(topic_name:) ⇒ Object
To ensure a route will always generate, we need to encode
topic_name.
Instance Method Details
#topic_explore_projects_cleaned_path(topic_name:) ⇒ Object
To ensure a route will always generate, we need to encode topic_name. Otherwise, various pages will encounter ‘No route matches` error.
This does mean some double encoding as Rails ActionDispatch also encodes segments but that is OK
Also, controllers that use params[:topic_name] will now need to perform decode_www_form_component.
13 14 15 16 17 |
# File 'app/helpers/projects/topics_helper.rb', line 13 def topic_explore_projects_cleaned_path(topic_name:) topic_name = URI.encode_www_form_component(topic_name) if Feature.enabled?(:explore_topics_cleaned_path) topic_explore_projects_path(topic_name: topic_name) end |