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])
|
|
|
|
if @thing.adopted?
|
2013-12-02 22:52:37 +00:00
|
|
|
if user_signed_in? && current_user == @thing.user
|
2014-04-01 08:15:29 +00:00
|
|
|
render('users/thank_you')
|
2011-05-31 11:12:02 +00:00
|
|
|
else
|
2014-04-01 08:15:29 +00:00
|
|
|
render('users/profile')
|
2011-05-31 11:12:02 +00:00
|
|
|
end
|
|
|
|
else
|
|
|
|
if user_signed_in?
|
2014-04-01 08:15:29 +00:00
|
|
|
render('things/adopt')
|
2011-05-31 11:12:02 +00:00
|
|
|
else
|
2014-04-01 08:15:29 +00:00
|
|
|
render('users/sign_in')
|
2011-05-31 11:12:02 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|