Fix bug in show_from_link

This commit is contained in:
Christophe Vilayphiou 2012-09-12 16:46:03 +08:00
parent 46177000e0
commit 3432d1359b
1 changed files with 2 additions and 1 deletions

View File

@ -47,8 +47,9 @@ class PagesController < ApplicationController
end
def show_from_link
url = "/#{@item.path}?id=#{params[:id]}"
url = "/#{@item.path}"
options = ''
options << "#{options.blank? ? '?' : '&'}id=#{params[:id]}" unless params[:id].blank?
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
options << "#{options.blank? ? '?' : '&'}preview=#{params[:preview]}" unless params[:preview].blank?