Skip to content

Instantly share code, notes, and snippets.

@scottharvey
Created May 10, 2011 06:28
Show Gist options
  • Save scottharvey/964002 to your computer and use it in GitHub Desktop.
Save scottharvey/964002 to your computer and use it in GitHub Desktop.
def update
milestone = @project.milestones.find(params[:id])
params[:milestone]['invoice_on_completion'] = "0" unless params[:milestone]['invoice_on_completion']
if milestone.update_attributes(params[:milestone])
respond_to do |format|
format.js { render :json => milestone }
end
else
respond_to do |format|
format.js { render :json => milestone.errors.full_messages, :status => :bad_request }
end
end
end
@mwotton
Copy link

mwotton commented May 10, 2011

foo ={}
{}
foo['bar'] ||= "0"
"0"
foo
{
"bar" => "0"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment