Skip to content

Instantly share code, notes, and snippets.

@abhianair
Created December 4, 2018 04:33
Show Gist options
  • Save abhianair/98e8b2715d722fa8105760439d80baca to your computer and use it in GitHub Desktop.
Save abhianair/98e8b2715d722fa8105760439d80baca to your computer and use it in GitHub Desktop.
To check if a user already have tuple
before_action :check_have, only: [:new]
def check_have
if Profile.where(:user_id=>current_user.id).present?
redirect_to root_path
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment