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

12 lines
333 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])
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