Guest User

Untitled

a guest
Jun 21st, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. class Users::RegistrationsController < Devise::RegistrationsController
  2.  
  3. def create
  4. build_resource
  5.  
  6. if resource.save
  7. set_flash_message :notice, :signed_up
  8. sign_in(resource_name, resource)
  9. # "paypal" payment provider and "pro" subscription
  10. # :user_id is passed back to you in the on_success and on_cancellation callbacks
  11. # redirects user to paypal
  12. # this could be easily changed to accept params so you could have user choose which payment provider
  13. # and which subscription level
  14. cinchy_subscribe!("paypal", "pro", :user_id => resource.id)
  15. else
  16. clean_up_passwords(resource)
  17. render_with_scope :new
  18. end
  19. end
  20. end
Add Comment
Please, Sign In to add comment