From 6d2782d9db28617178b8c3c8bb6b363f726a2361 Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 8 Jun 2010 18:35:39 -0400 Subject: [PATCH] move item swf asset JSON routes into a /items/ subdirectory, and gitignore the contents of that and /pet_types/ --- config/routes.rb | 4 ++-- public/items/.gitignore | 1 + public/javascripts/items/show.js | 4 ++-- public/pet_types/.gitignore | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 public/items/.gitignore create mode 100644 public/pet_types/.gitignore diff --git a/config/routes.rb b/config/routes.rb index b482893f..158b2969 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -2,8 +2,8 @@ OpenneoImpressItems::Application.routes.draw do |map| match '/' => 'items#index', :as => :items match '/:id' => 'items#show', :as => :item - match '/:item_id/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets - match '/:item_id/bodies/:body_id/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets_for_body_id + match '/items/:item_id/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets + match '/items/:item_id/bodies/:body_id/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets_for_body_id 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' diff --git a/public/items/.gitignore b/public/items/.gitignore new file mode 100644 index 00000000..a6c57f5f --- /dev/null +++ b/public/items/.gitignore @@ -0,0 +1 @@ +*.json diff --git a/public/javascripts/items/show.js b/public/javascripts/items/show.js index 318c1086..af1961bc 100644 --- a/public/javascripts/items/show.js +++ b/public/javascripts/items/show.js @@ -123,7 +123,7 @@ function Item(id) { this.assets_by_body_id = {}; this.load = function (pet_type) { - var url = '/' + id + '/bodies/' + pet_type.body_id + '/swf_assets.json', + var url = '/items/' + id + '/bodies/' + pet_type.body_id + '/swf_assets.json', item = this; if(this.getAssetsForPetType(pet_type).length) { pet_type.onUpdate(); @@ -136,7 +136,7 @@ function Item(id) { this.loadAllStandard = function () { var item = this; - $.getJSON('/' + id + '/swf_assets.json', function (assets_by_body_id) { + $.getJSON('/items/' + id + '/swf_assets.json', function (assets_by_body_id) { $.each(assets_by_body_id, function (i) { item.assets_by_body_id[parseInt(i)] = this; }); diff --git a/public/pet_types/.gitignore b/public/pet_types/.gitignore new file mode 100644 index 00000000..a6c57f5f --- /dev/null +++ b/public/pet_types/.gitignore @@ -0,0 +1 @@ +*.json