Created
December 19, 2008 16:44
-
-
Save bobbywilson0/38040 to your computer and use it in GitHub Desktop.
This file contains 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
def join_link | |
return if @appointment.full? | |
return "#{link_to 'register', new_client_path} or #{link_to 'log in', '/login'} to join this class" if !current_user | |
return 'Incorrect role, must be a client to sign up for a class' if !current_user.has_role?('client') | |
return 'You are already signed up for this class' if current_user.appointments.include?(@appointment) | |
link_to 'join class', add_client_to_appointment | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment