2011-05-31 11:12:02 +00:00
|
|
|
class InfoWindowController < ApplicationController
|
|
|
|
def index
|
2011-09-15 21:41:26 +00:00
|
|
|
@thing = Thing.find_by_id(params[:thing_id])
|
2014-08-15 13:39:51 +00:00
|
|
|
view = if @thing.adopted?
|
|
|
|
user_signed_in? && current_user == @thing.user ? 'users/thank_you' : 'users/profile'
|
2011-05-31 11:12:02 +00:00
|
|
|
else
|
2014-08-15 13:39:51 +00:00
|
|
|
user_signed_in? ? 'things/adopt' : 'users/sign_in'
|
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
|