Closed Codcore closed 2 years ago
So we can do like (pseudo code):
UserCreate.run(params: user_params) do |u| if u redirect_to users_path else render 'users/new' end end
You can do this with tap. I'd prefer to save the block for some possible future use.
tap
UserCreate.run(params: user_params).tap do |u| if u redirect_to users_path else render 'users/new' end end
So we can do like (pseudo code):