Commit 8c6bca299a63f9c7d882504e894f2e997bb3fd54

Authored by Victor Costa
1 parent 287d9504

rails3: fix params from routes with wildcards

Routes with wildcards returns string (do not need to transform from array to string anymore).
app/controllers/application_controller.rb
... ... @@ -167,7 +167,7 @@ class ApplicationController < ActionController::Base
167 167  
168 168 def load_category
169 169 unless params[:category_path].blank?
170   - path = params[:category_path].join('/')
  170 + path = params[:category_path]
171 171 @category = environment.categories.find_by_path(path)
172 172 if @category.nil?
173 173 render_not_found(path)
... ...
app/controllers/public/content_viewer_controller.rb
... ... @@ -6,7 +6,7 @@ class ContentViewerController < ApplicationController
6 6 helper TagsHelper
7 7  
8 8 def view_page
9   - path = params[:page].join('/')
  9 + path = params[:page]
10 10  
11 11 if path.blank?
12 12 @page = profile.home_page
... ...
app/controllers/public/search_controller.rb
... ... @@ -159,7 +159,7 @@ class SearchController < PublicController
159 159 if params[:category_path].blank?
160 160 render_not_found if params[:action] == 'category_index'
161 161 else
162   - path = params[:category_path].join('/')
  162 + path = params[:category_path]
163 163 @category = environment.categories.find_by_path(path)
164 164 if @category.nil?
165 165 render_not_found(path)
... ...