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

14 lines
361 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])
2015-04-20 12:18:37 +00:00
view = begin
if @thing.adopted?
user_signed_in? && current_user == @thing.user ? 'users/thank_you' : 'users/profile'
else
user_signed_in? ? 'things/adopt' : 'users/sign_in'
end
2011-05-31 11:12:02 +00:00
end
2014-08-15 13:39:51 +00:00
render view
2011-05-31 11:12:02 +00:00
end
end