Class: VisitorsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/visitors_controller.rb', line 7

def create
  @visitor = Visitor.new(secure_params)
  if @visitor.valid?
    @visitor.subscribe
    flash[:notice] = "Signed up #{@visitor.email}."
    redirect_to root_path
  else
    render :new
  end
end

#newObject



3
4
5
# File 'app/controllers/visitors_controller.rb', line 3

def new
  @visitor = Visitor.new
end