rauhryan
8/17/2012 - 2:17 PM

gistfile1.rb

class PhotosController < ApplicationController
  
  respond_to :json
  
  def index
    @photos = Photo.all
    
    respond_with({:photos => @photos}.as_json)
  end
  
  def create
    @photo = Photo.create(params[:photo])
    
    respond_with(@photo)
  end
  
end