Class: Alphabeta::SignupController

Inherits:
ApplicationController show all
Defined in:
app/controllers/alphabeta/signup_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
# File 'app/controllers/alphabeta/signup_controller.rb', line 12

def create
  @signup = Alphabeta::Signup.new(params[:signup])
  if @signup.save
    SignupMailer.intro_mail(@signup.email).deliver
    flash[:notice] = I18n.t('signup_successful')
    redirect_to root_path
  else 
    render action: 'new'
  end
end

#newObject



8
9
10
# File 'app/controllers/alphabeta/signup_controller.rb', line 8

def new
  @signup = Alphabeta::Signup.new
end