Created
March 11, 2023 22:59
-
-
Save phensalves/0286b7baa959301016b277dcc542b5df to your computer and use it in GitHub Desktop.
Examples for Clean Architecture article
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 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