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

19 lines
414 B
Ruby
Raw Normal View History

2011-05-31 11:12:02 +00:00
class InfoWindowController < ApplicationController
def index
@thing = Thing.find_by_id(params[:thing_id])
if @thing.adopted?
if user_signed_in? && current_user == @thing.user
2011-05-31 11:12:02 +00:00
render("users/thank_you")
else
render("users/profile")
end
else
if user_signed_in?
render("things/adopt")
2011-05-31 11:12:02 +00:00
else
2011-12-25 07:23:19 +00:00
render("users/sign_in")
2011-05-31 11:12:02 +00:00
end
end
end
end