From f2706ff2c1a8871406cea4fe07319af8e33b976e Mon Sep 17 00:00:00 2001 From: "Matthew K. Fu JuYuan" Date: Wed, 29 May 2013 16:23:31 +0800 Subject: [PATCH] make default widget work with params[tag_id] params[category_id] --- lib/parsers/parser_front_end.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/parsers/parser_front_end.rb b/lib/parsers/parser_front_end.rb index 0ffb4f0f..472c302b 100644 --- a/lib/parsers/parser_front_end.rb +++ b/lib/parsers/parser_front_end.rb @@ -19,10 +19,8 @@ module ParserFrontEnd end def parse_page_content(page,args=nil) - try{ args["category_id"] = args["category_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if args["category_id"].is_a? String - args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if args["category_id"].is_a? String - } + args["tag_id"] = args["tag_id"].gsub(/\"|\[|\]/,'').split(",").each(&:strip!) if args["tag_id"].is_a? String # tag = params[:tag_id].blank? ? page[:tag] : params[:tag_id] # category = params[:category_id].blank? ? page[:category] : params[:category_id] body = Nokogiri::HTML(page.content) @@ -159,7 +157,7 @@ module ParserFrontEnd categories_str = "&#{categories_str}" unless categories_str.blank? tags_str = "&#{tags_str}" unless tags_str.blank? - options = "&part_id=\#{part.id}#{categories_str}#{tags_str}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&clicked_field_name=\#{params[:clicked_field_name]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}&item_type=page_part" + options = "&part_id=\#{part.id}#{categories_str}#{tags_str}&page=\#{params[:page]}&search_query=\#{params[:search_query]}&clicked_field_name=\#{params[:clicked_field_name]}&part_title=\#{Rack::Utils.escape(part_title).gsub(\"\+\", \"\%20\") rescue nil}&item_type=page_part&tag_id=\#{params[:tag_id]}&category_id=\#{params[:category_id]}" ret << "" when 'public_r_tag'