summaryrefslogtreecommitdiff
path: root/app/controllers/sign_ups_controller.rb
blob: 06a071905d5757465ea7e00526ff57617d6fe43f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class SignUpsController < ApplicationController
  def new
    @sign_up = SignUp.new
  end

  def create
    @sign_up = SignUp.create(sign_up_params)

    if @sign_up.save
      @sign_up.subscribe
      redirect_to @sign_up
    else
      render action: "new"
    end
  end

  def show
  end

  private

  def sign_up_params
    params.require(:sign_up).permit(:email)
  end
end