Innovation Cloud Ruby On Rails

I am stuck at the end of the project.

I saw the GET HELP solution video, Still I cannot route to the next page after submitting a e-mail address to the root page.

And the error shows like ActionController::InvalidAuthenticityToken in SignupsController#create when I try to submit and go to next page.

I did everything exactly shows as in tutorial, But Still I cannot figure Out the error.

Routes.rb

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

  root 'signups#new'

end

signups_controller.rb

class SignupsController < ApplicationController
  def new
    @signup = Signup.new
  end

  def create
    @signup = Signup.new(signup_params)
    if @signup.save
      redirect_to '\thanks'
    end
  end
  
  private
  def signup_params
    params.require(:signup).permit(:email)
  end
end

Help me With this.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.