Created
February 1, 2016 07:18
-
-
Save KamilLelonek/f6e14872250771cd78fa to your computer and use it in GitHub Desktop.
Tell-Don't-Ask violation
This file contains hidden or 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 ClientsController < ApplicationController | |
def create | |
@client = Client.new(params[:client]) | |
if @client.save | |
redirect_to @client | |
else | |
flash.now[:error] = "Could not save client" | |
render action: "new" | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment