Skip to content

Instantly share code, notes, and snippets.

@phensalves
Created March 11, 2023 22:59
Show Gist options
  • Save phensalves/0286b7baa959301016b277dcc542b5df to your computer and use it in GitHub Desktop.
Save phensalves/0286b7baa959301016b277dcc542b5df to your computer and use it in GitHub Desktop.
Examples for Clean Architecture article
class UserController < ApplicationController
def index
@users = User.all
end
def create
@user = User.new(user_params)
if @user.save
redirect_to users_path
else
render 'new'
end
end
private
def user_params
params.require(:user).permit(:name, :email, :password)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment