Finished Chapter 12
[depot.git] / app / controllers / info_controller.rb
1 class InfoController < ApplicationController
2 def who_bought
3 @product = Product.find(params[:id])
4 @orders = @product.orders
5 respond_to do |format|
6 format.html
7 format.xml {render :layout => false}
8 format.atom {render :layout => false}
9 format.json {render :layout => false, :json => @product.to_json(:include => :orders) }
10 end
11 end
12
13 protected
14
15 def authorize
16 end
17 end