Created
December 4, 2018 04:33
-
-
Save abhianair/98e8b2715d722fa8105760439d80baca to your computer and use it in GitHub Desktop.
To check if a user already have tuple
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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