fix for passing args. code in complete,fronted controller need to take care params,too. backend parser need to catch up.
This commit is contained in:
1 parent
f2706ff2c1
commit
7729161123
9 files changed
+71
-15
No files matched your search
@@ -110,7 +110,7 @@ class ApplicationController < ActionController::Base
|
||||
end
|
||||
|
||||
# Render the page
|
||||
def render_page(args=nil)
|
||||
def render_page(args={})
|
||||
if @item
|
||||
respond_to do |format|
|
||||
format.html { render :text => parse_page_content(@item,args), :layout => 'page_layout' }
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
class OrbitWidgetController< OrbitFrontendComponentController
|
||||
include FrontEndArrayParamsHelper
|
||||
|
||||
before_filter :get_tags_and_cates
|
||||
|
||||
def get_tags_and_cates
|
||||
binding.pry
|
||||
params = tags_and_cates(params)
|
||||
end
|
||||
|
||||
end
|
||||
@@ -45,12 +45,28 @@ class PagesController < ApplicationController
|
||||
#end
|
||||
end
|
||||
|
||||
def convert_array_param(key,array)
|
||||
array.collect{|t| "#{key}[]=#{t}"}.join("&")
|
||||
end
|
||||
|
||||
def index_from_link
|
||||
url = "/#{@item.path}"
|
||||
options = ''
|
||||
options << "#{options.blank? ? '?' : '&'}page_main=#{params[:page_main]}" unless params[:page_main].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?
|
||||
|
||||
if params[:category_id].is_a? Array
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('category_id',params[:category_id])}" unless params[:category_id].blank?
|
||||
elsif params[:category_id].is_a? String
|
||||
options << "#{options.blank? ? '?' : '&'}category_id=#{params[:category_id]}" unless params[:category_id].blank?
|
||||
end
|
||||
|
||||
if params[:tag_id].is_a? Array
|
||||
options << "#{options.blank? ? '?' : '&'}#{convert_array_param('tag_id',params[:tag_id])}" unless params[:tag_id].blank?
|
||||
elsif params[:category_id].is_a? String
|
||||
options << "#{options.blank? ? '?' : '&'}tag_id=#{params[:tag_id]}" unless params[:tag_id].blank?
|
||||
end
|
||||
|
||||
|
||||
options << "#{options.blank? ? '?' : '&'}search_query=#{params[:search_query]}" unless params[:search_query].blank?
|
||||
options << "#{options.blank? ? '?' : '&'}name=#{params[:name]}" unless params[:name].blank?
|
||||
uri = URI::escape(url + options)
|
||||
|
||||
Reference in new issue
Block a user