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

19 lines
420 B
Ruby

class InfoWindowController < ApplicationController
def index
@thing = Thing.find_by_id(params[:thing_id])
if @thing.adopted?
if user_signed_in? && current_user.id == @thing.user_id
render("users/thank_you")
else
render("users/profile")
end
else
if user_signed_in?
render("things/adopt")
else
render("users/sign_in")
end
end
end
end