From 4ba6af20ad84d9994c8f2713d81d740b0c06a765 Mon Sep 17 00:00:00 2001 From: Matchu Date: Sat, 26 Jun 2010 16:29:23 -0400 Subject: [PATCH] item zone sets jsonp controller --- app/controllers/item_zone_sets_controller.rb | 5 +++++ app/helpers/item_zone_sets_helper.rb | 2 ++ config/routes.rb | 2 ++ spec/controllers/item_zone_sets_controller_spec.rb | 5 +++++ 4 files changed, 14 insertions(+) create mode 100644 app/controllers/item_zone_sets_controller.rb create mode 100644 app/helpers/item_zone_sets_helper.rb create mode 100644 spec/controllers/item_zone_sets_controller_spec.rb diff --git a/app/controllers/item_zone_sets_controller.rb b/app/controllers/item_zone_sets_controller.rb new file mode 100644 index 00000000..6ad3fe37 --- /dev/null +++ b/app/controllers/item_zone_sets_controller.rb @@ -0,0 +1,5 @@ +class ItemZoneSetsController < ApplicationController + def index + render :json => Zone::ItemZoneSets.keys.sort.as_json, :callback => params[:callback] + end +end diff --git a/app/helpers/item_zone_sets_helper.rb b/app/helpers/item_zone_sets_helper.rb new file mode 100644 index 00000000..4aabf267 --- /dev/null +++ b/app/helpers/item_zone_sets_helper.rb @@ -0,0 +1,2 @@ +module ItemZoneSetsHelper +end diff --git a/config/routes.rb b/config/routes.rb index 3fd984fc..7fa82fa1 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,4 +8,6 @@ OpenneoImpressItems::Application.routes.draw do |map| match '/pet_types/:pet_type_id/swf_assets.json' => 'swf_assets#index', :as => :pet_type_swf_assets match '/species/:species_id/color/:color_id/pet_type.json' => 'pet_types#show' + + match '/item_zone_sets.js' => 'ItemZoneSets#index' end diff --git a/spec/controllers/item_zone_sets_controller_spec.rb b/spec/controllers/item_zone_sets_controller_spec.rb new file mode 100644 index 00000000..31b7341c --- /dev/null +++ b/spec/controllers/item_zone_sets_controller_spec.rb @@ -0,0 +1,5 @@ +require 'spec_helper' + +describe ItemZoneSetsController do + +end