Class: BetterAuthy::RegistrationsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/better_authy/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#create ⇒ Object



12
13
14
15
16
17
18
19
20
# File 'app/controllers/better_authy/registrations_controller.rb', line 12

def create
  @resource = scope_config.model_class.new(resource_params)
  if @resource.save
    send(:"sign_in_#{scope_name}", @resource)
    redirect_to scope_config.
  else
    render :new, status: :unprocessable_content
  end
end

#new ⇒ Object



8
9
10
# File 'app/controllers/better_authy/registrations_controller.rb', line 8

def new
  @resource = scope_config.model_class.new
end