adopt-a-hydrant/app/controllers/hydrants_controller.rb

13 lines
287 B
Ruby
Raw Normal View History

2011-03-08 08:44:27 +00:00
class HydrantsController < ApplicationController
respond_to :json
def update
@hydrant = Hydrant.find(params[:id])
if @hydrant.update_attributes(params[:hydrant])
render(:json => @hydrant)
2011-03-08 08:44:27 +00:00
else
render(:json => {"errors" => @hydrant.errors})
end
end
end