Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Users::RegistrationsController < Devise::RegistrationsController
- def new
- build_resource({})
- resource.build_extra_phone_numbers
- render_with_scope :new
- end
- def create
- # Copied and pasted from devise/app/controllers/devise/registrations_controller.rb
- build_resource
- if resource.save
- if resource.active?
- sign_in resource
- redirect_to payment_url(resource)
- else
- set_flash_message :notice, :inactive_signed_up, :reason => resource.inactive_message.to_s
- redirect_to after_inactive_sign_up_path_for(resource)
- end
- else
- resource.build_extra_phone_numbers
- clean_up_passwords(resource)
- render_with_scope :new
- end
- end
- def payment_url(user)
- receipt = user.payment_receipts.create
- receipt.payment_url(payment_receipt_url(receipt))
- end
- end
Add Comment
Please, Sign In to add comment