 get '/filter/section/:id' do |id_s| 
  # get filter criteria for a section with id
  FilterCriteria.where(:owner_type => "Section").where(:owner_id => id_s.to_i).to_json(
    :include => [:filter_criteria_values]
  )
end

get '/filter/category/:id' do |id_s|
  # get filter criteria for a category with id
  FilterCriteria.where(:owner_type => "Category").where(:owner_id => id_s.to_i).to_json(
    :include => [:filter_criteria_values]
  )
end

get '/filter/subcategory/:id' do |id_s|
  # get filter criteria for a subcategory with id
  FilterCriteria.where(:owner_type => "Subcategory").where(:owner_id => id_s.to_i).to_json(
    :include => [:filter_criteria_values]
  )
end
