Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created September 16, 2019 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/298ca04cd88b85a19b9c9c86d3d10570 to your computer and use it in GitHub Desktop.
Save codecademydev/298ca04cd88b85a19b9c9c86d3d10570 to your computer and use it in GitHub Desktop.
Codecademy export
class PagesController < ApplicationController
def thanks
end
end
class SignupsController < ApplicationController
def new
@signup = Signup.new
end
private
def signup_params
params.require(:signup).permit(:email)
end
def create
@signup = Signup.new(signup_params)
if @signup.save
redirect_to thanks_url
else
flash[:alert] = 'User was not saved.'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment