Skip to content

Commit

Permalink
added redirect when a product is loaded directly
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminleesmith committed May 10, 2011
1 parent 947cb4f commit 9dfff3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/controllers/products_controller.rb
@@ -1,6 +1,12 @@
class ProductsController < ApplicationController
respond_to :js
def show
respond_with(@product = Product.find(params[:id]))
respond_to do |format|
format.js {@product = Product.find(params[:id])}
format.html {
product = Product.find(params[:id])
redirect_to store_url(product.store, :product_id => product.id)
}
end
end
end

0 comments on commit 9dfff3f

Please sign in to comment.