forked from OpenNeo/impress
move item swf asset JSON routes into a /items/ subdirectory, and gitignore the contents of that and /pet_types/
This commit is contained in:
parent
37372544b0
commit
6d2782d9db
4 changed files with 6 additions and 4 deletions
|
@ -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'
|
||||
|
|
1
public/items/.gitignore
vendored
Normal file
1
public/items/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.json
|
|
@ -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;
|
||||
});
|
||||
|
|
1
public/pet_types/.gitignore
vendored
Normal file
1
public/pet_types/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
*.json
|
Loading…
Reference in a new issue