Skip to content

Instantly share code, notes, and snippets.

@KamilLelonek
Created February 1, 2016 07:18
Show Gist options
  • Save KamilLelonek/f6e14872250771cd78fa to your computer and use it in GitHub Desktop.
Save KamilLelonek/f6e14872250771cd78fa to your computer and use it in GitHub Desktop.
Tell-Don't-Ask violation
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