I'm working on a subscription app for a coffee shop. Right now a subscriber can sign in with their phone number. After they sign in, it will direct them to a page that will show the subscriber some stats about how much money they've spent, times visited, etc.. My question is this. If there no keys have been pressed or no clicks were made on that page is there a way a can make the page redirect back to the home page? Only if there is no action on the page from the user. I feel as though this would be a Javascript thing but I'm not sure? Let me know if you need any more info? Thanks!
sign in method:
def search
@subscriber = Subscriber.new
end
def visit
@subscriber = Subscriber.find_by_phone_number(params[:phone_number])
if @subscriber
@subscriber.visit ||= 0
@subscriber.visit += 1
@subscriber.save
render "visit"
end
end