Email not being saved


Hi, can someone please help me figure out what I'm doing wrong?
When I submit an email address, I get an error:

Started POST "/signups" for at 2015-10-24 14:00:29 -0400                                    
Processing by SignupsController#create as HTML                                                           
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"3zOsHWDDohipOnmYjT1y2TRaSDXawNvDbwkC36FzP0g=", "signup
"=>{"email"=>""}, "commit"=>"signup"}                                                   
Completed 400 Bad Request in 0ms                                                                         
ActionController::ParameterMissing (param is missing or the value is empty: email):                      
  app/controllers/signups_controller.rb:19:in `signup_params'                                            
  app/controllers/signups_controller.rb:9:in `create'

Here is my signup controller:

class SignupsController < ApplicationController
  def new
    @signup =
  def create 
    @signup = 
      redirect_to '/thanks' 
      render 'new' 
  def signup_params

The email field is in the schema - migrate scrip:

create_table :signups do |t|
  t.text :email

It's baffling to me, the email parameter is there, but it's not being saved (it just says 'nil' in the DB). Any ideas?



answering my own question :wink:

I got the signup_params wrong. it should be



Hi Marco,

I have a little problem with this exercice.
I have the same signup controller and same migrate script of you,

but I have an error message in the task 12 :

ActionController::InvalidAuthenticityToken in SignupsController#create

Could you please tell me what you typed in routes file :confused:

Thanks !


That's a weird error :wink:

My routes.rb looks like this

Rails.application.routes.draw do
  get '/thanks' => 'pages#thanks'
  resources :signups
  root 'signups#new'


I will begin to the start again. :sweat:
Some stuff still a little bit confused with this exercice.



Seen the error related to the InvalidAuthenticityToken before in a few other exercises. The file application_controller.rb needs to look something like this:

class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead.
protect_from_forgery with: :null_session


Yes, this change from ":exception" to ":null_session" worked for me ... after an extensive review of what turned out to be immaculate code. :smile:


Having a terrible experience with code academy ... i am thinking to get a refund! First i was getting
ActionController::InvalidAuthenticityToken in SignupsController#create
then when i reset the project - it is crashing and hanging on creating model :tired_face: :sob: i have reset it a couple of times no help! Any recommended browser?
$ rails generate model Signup
Warning: You're using Rubygems 2.0.14 with Spring. Up
grade to at least Rubygems 2.1.0 and run gem pristin
e --all
for better startup performance. .... hangs here


This is still a problem in the “Authorization” course … and really horrid. I am not sure why someone at CodeAcademy has not fixed it or provided some help text to guide to a soluton.