Skip to content

Instantly share code, notes, and snippets.

@anoobbava
Last active May 28, 2018 13:54
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 anoobbava/b1a856e6d9b732cbd1565e5a643714ce to your computer and use it in GitHub Desktop.
Save anoobbava/b1a856e6d9b732cbd1565e5a643714ce to your computer and use it in GitHub Desktop.
users controller for delayed_job recurring example
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