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

19 lines
467 B
Ruby
Raw Normal View History

2011-03-18 02:33:20 +00:00
class ContentsController < ApplicationController
def index
@hydrant = Hydrant.find_by_id(params[:hydrant_id])
if @hydrant.adopted?
if user_signed_in? && current_user.id == @hydrant.user_id
render(:partial => "thank_you")
else
render(:partial => "user_profile")
end
else
if user_signed_in?
render(:partial => "adoption_form")
else
render(:partial => "combo_form")
end
end
end
end