Innovation Cloud Step 15

On step 15, I get the error:

undefined method `email' for #<Signup id: nil, created_at: nil, updated_at: nil>

Seems to have something to do with creating the email form:

        <%= form_for(@signup) do |f| %>
              <%= f.text_field :email, :placeholder => "Email" %>
        <%= f.submit "Join", :class => 'btn' %>
        <% end %>

Because if I take out the f.text_field line it works fine (although there is no text field to add the email).

My db:migrate file has the email field added, so I don’t know what the problem is.

class CreateSignups < ActiveRecord::Migration
  def change
    create_table :signups do |t|

      t.string :email

      t.timestamps
    end
  end
end
1 Like

Did you ever figure this out? I’m getting the same error.

Not sure if you figured out the above, but I ran into the same error.

In my case it looked like the issue is with a failure to migrate the database to include the signup model, so that when i ran ‘bundle exec rake db:migrate’ it did not work properly.

I was not sure how to fix this, so i reset the code and then went through all the instructions again and it seemed to work.