Commit 8c6bca299a63f9c7d882504e894f2e997bb3fd54
1 parent
287d9504
Exists in
master
and in
27 other branches
rails3: fix params from routes with wildcards
Routes with wildcards returns string (do not need to transform from array to string anymore).
Showing
3 changed files
with
3 additions
and
3 deletions
Show diff stats
app/controllers/application_controller.rb
@@ -167,7 +167,7 @@ class ApplicationController < ActionController::Base | @@ -167,7 +167,7 @@ class ApplicationController < ActionController::Base | ||
167 | 167 | ||
168 | def load_category | 168 | def load_category |
169 | unless params[:category_path].blank? | 169 | unless params[:category_path].blank? |
170 | - path = params[:category_path].join('/') | 170 | + path = params[:category_path] |
171 | @category = environment.categories.find_by_path(path) | 171 | @category = environment.categories.find_by_path(path) |
172 | if @category.nil? | 172 | if @category.nil? |
173 | render_not_found(path) | 173 | render_not_found(path) |
app/controllers/public/content_viewer_controller.rb
@@ -6,7 +6,7 @@ class ContentViewerController < ApplicationController | @@ -6,7 +6,7 @@ class ContentViewerController < ApplicationController | ||
6 | helper TagsHelper | 6 | helper TagsHelper |
7 | 7 | ||
8 | def view_page | 8 | def view_page |
9 | - path = params[:page].join('/') | 9 | + path = params[:page] |
10 | 10 | ||
11 | if path.blank? | 11 | if path.blank? |
12 | @page = profile.home_page | 12 | @page = profile.home_page |
app/controllers/public/search_controller.rb
@@ -159,7 +159,7 @@ class SearchController < PublicController | @@ -159,7 +159,7 @@ class SearchController < PublicController | ||
159 | if params[:category_path].blank? | 159 | if params[:category_path].blank? |
160 | render_not_found if params[:action] == 'category_index' | 160 | render_not_found if params[:action] == 'category_index' |
161 | else | 161 | else |
162 | - path = params[:category_path].join('/') | 162 | + path = params[:category_path] |
163 | @category = environment.categories.find_by_path(path) | 163 | @category = environment.categories.find_by_path(path) |
164 | if @category.nil? | 164 | if @category.nil? |
165 | render_not_found(path) | 165 | render_not_found(path) |