1
0
Fork 0
forked from OpenNeo/impress
impress/config/routes.rb
Matchu 9701221035 wardrobe now considers item.species_support_ids when deciding compatibility
For example, the Meerca Maid Tray is a foreground item, so the SWF is marked
as compatible with all body types, but the item itself is clearly marked as
Meercas-only. items#show reflected this properly, but the swf_assets#index
call that the wardrobe uses ignored item.species_support_ids.

So, /bodies/:body_id/swf_assets.json?item_ids[]=... was deprecated in favor
of /pet_types/:pet_type_id/items/swf_assets.json?item_ids=[]..., which is
much like the former route but, before loading assets, also loads the pet
type and items, then filters the items by compatibility, then only loads
assets for the compatible items.
2013-01-02 23:15:32 -05:00

89 lines
3.3 KiB
Ruby

OpenneoImpressItems::Application.routes.draw do |map|
get "petpages/new"
get "closet_lists/new"
get "closet_lists/create"
root :to => 'outfits#new'
devise_for :users
match '/item_zone_sets.json' => 'ItemZoneSets#index'
# DEPRECATED
match '/bodies/:body_id/swf_assets.json' => 'swf_assets#index', :as => :body_swf_assets
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 '/pet_types/:pet_type_id/items/swf_assets.json' => 'swf_assets#index', :as => :item_swf_assets_for_pet_type
match '/pet_states/:pet_state_id/swf_assets.json' => 'swf_assets#index', :as => :pet_state_swf_assets
match '/species/:species_id/color/:color_id/pet_type.json' => 'pet_types#show'
match '/roulette' => 'roulettes#new', :as => :roulette
resources :broken_image_reports, :only => [:new, :create]
resources :contributions, :only => [:index]
resources :items, :only => [:index, :show] do
collection do
get :needed
end
end
resources :outfits, :only => [:show, :create, :update, :destroy]
resources :pet_attributes, :only => [:index]
resources :swf_assets, :only => [:index, :show]
scope 'import' do
resources :closet_pages, :only => [:new, :create],
:controller => 'neopets_pages', :path => 'closet/pages', :type => 'closet'
resources :safety_deposit_pages, :only => [:new, :create],
:controller => 'neopets_pages', :path => 'sdb/pages', :type => 'sdb'
resources :neopets_users, :only => [:new, :create], :path => 'neopets-users'
end
match '/users/current-user/outfits' => 'outfits#index', :as => :current_user_outfits
match '/pets/load' => 'pets#load', :method => :post, :as => :load_pet
match '/modeling' => 'pets#bulk', :as => :bulk_pets
match '/login' => 'sessions#new', :as => :login
match '/logout' => 'sessions#destroy', :as => :logout
match '/users/authorize' => 'sessions#create'
resources :users, :path => 'user', :only => [:index, :update] do
resources :contributions, :only => [:index]
resources :closet_hangers, :only => [:index, :update, :destroy], :path => 'closet' do
collection do
get :petpage
end
end
resources :closet_lists, :only => [:new, :create, :edit, :update, :destroy], :path => 'closet/lists'
resources :items, :only => [] do
resources :closet_hangers, :only => [:create] do
collection do
put :update_quantities
end
end
end
end
match 'users/current-user/closet' => 'closet_hangers#index', :as => :your_items
match 'users/top-contributors' => 'users#top_contributors', :as => :top_contributors
match 'users/top_contributors' => redirect('/users/top-contributors')
match '/wardrobe' => 'outfits#edit', :as => :wardrobe
match '/start/:color_name/:species_name' => 'outfits#start'
match '/donate' => 'static#donate', :as => :donate
match 'image-mode' => 'static#image_mode', :as => :image_mode
match '/terms' => 'static#terms', :as => :terms
match '/sitemap.xml' => 'sitemap#index', :as => :sitemap, :format => :xml
match '/robots.txt' => 'sitemap#robots', :as => :robots, :format => :text
end