Last active
May 28, 2018 13:54
-
-
Save anoobbava/b1a856e6d9b732cbd1565e5a643714ce to your computer and use it in GitHub Desktop.
users controller for delayed_job recurring example
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 UsersController < ApplicationController | |
def new | |
@user = UserInformation.new | |
end | |
def index | |
@users = UserInformation.all | |
end | |
def create | |
@user = UserInformation.new(permit_params) | |
if @user.save | |
flash[:notice] = 'User information created' | |
redirect_to :root | |
else | |
render 'new' | |
end | |
end | |
private | |
def permit_params | |
params.require(:user_information).permit(:first_name, :last_name, :secret_message) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment