From b2a7e0a1d5b16f1227bc002b73ab0a877b197d74 Mon Sep 17 00:00:00 2001 From: Matchu Date: Wed, 23 May 2012 20:12:17 -0400 Subject: [PATCH 1/2] oops. accidentally used trading post url for auctions. fixed --- app/views/items/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/items/show.html.haml b/app/views/items/show.html.haml index 6d388a3b..bd888e34 100644 --- a/app/views/items/show.html.haml +++ b/app/views/items/show.html.haml @@ -13,7 +13,7 @@ = link_to 'Shop Wizard', shop_wizard_url_for(@item) = link_to 'Super Wizard', super_shop_wizard_url_for(@item) = link_to 'Trades', trading_post_url_for(@item) - = link_to 'Auctions', trading_post_url_for(@item) + = link_to 'Auctions', auction_genie_url_for(@item) - if user_signed_in? #closet-hangers From 71da64b47f159db6c05e450e74d0bddfd6f5afea Mon Sep 17 00:00:00 2001 From: Matchu Date: Tue, 5 Jun 2012 12:44:11 -0400 Subject: [PATCH 2/2] create /start/:species_name/:color_name route --- app/controllers/application_controller.rb | 4 ++++ app/controllers/outfits_controller.rb | 10 ++++++++++ config/routes.rb | 1 + 3 files changed, 15 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index ab722cc0..7072396b 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -14,6 +14,10 @@ class ApplicationController < ActionController::Base def can_use_image_mode? true end + + def not_found(record_name='record') + raise ActionController::RoutingError.new("#{record_name} not found") + end class AccessDenied < StandardError;end diff --git a/app/controllers/outfits_controller.rb b/app/controllers/outfits_controller.rb index 0ea71a19..7a4685df 100644 --- a/app/controllers/outfits_controller.rb +++ b/app/controllers/outfits_controller.rb @@ -69,6 +69,16 @@ class OutfitsController < ApplicationController format.json { render :json => @outfit } end end + + def start + @species = Species.find_by_name params[:species_name] + @color = Color.find_by_name params[:color_name] + if @species && @color + redirect_to wardrobe_path(:species => @species.id, :color => @color.id) + else + not_found('species/color') + end + end def update if @outfit.update_attributes(params[:outfit]) diff --git a/config/routes.rb b/config/routes.rb index 23be9817..98f9f3ba 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -74,6 +74,7 @@ OpenneoImpressItems::Application.routes.draw do |map| 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