Created
March 22, 2015 12:22
-
-
Save kinsomicrote/370695138fef9e028983 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 PatternsController < ApplicationController | |
def new | |
@pattern = Pattern.new | |
end | |
def create | |
@pattern = Pattern.new(pattern_params) | |
if @pattern.save | |
flash[:success] = "You have successfully registered!" | |
redirect_to pattern_path | |
else | |
render 'new' | |
end | |
end | |
private | |
def pattern_params | |
params.require(:pattern).permit(:name, :email, :telephone) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment