-
-
Save codecademydev/298ca04cd88b85a19b9c9c86d3d10570 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PagesController < ApplicationController | |
def thanks | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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