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
= form_for @user, url: register_user_path do |f| | |
- if @user.errors.any? | |
#error_explanation | |
%h2= "#{pluralize(@user.errors.count, "error")} prohibited this user from being saved:" | |
%%ul | |
- @user.errors.full_messages.each do |msg| | |
%li= msg | |
.field | |
= f.text_field :email, placeholder: 'Email' | |
.field#send_time.time.ui-timepicker-input |
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
devise_scope :user do | |
post 'register_user' => 'custom_users#create' | |
end |
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
class CustomUsersController < Devise::RegistrationsController | |
def new | |
super | |
end | |
def create | |
build_resource(sign_up_params) | |
if resource.save | |
set_text_message |
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 create | |
build_resource(sign_up_params) | |
if resource.save | |
set_text_message | |
update_text_message_user_id(@text_message) | |
sanitize_phone_number(@text_message) | |
send_welcome_text_message(@text_message.phone_number) | |
execute_text_message_worker(@text_message.id, @text_message.send_time, @text_message.user_id) |