Skip to content

Instantly share code, notes, and snippets.

@cmhobbs
Created February 19, 2010 04:06
Show Gist options
  • Save cmhobbs/308408 to your computer and use it in GitHub Desktop.
Save cmhobbs/308408 to your computer and use it in GitHub Desktop.
get '/edit/:acct' do
@title = "Edit Client Data"
@client = HE_Backend.get(params[:acct])
erb :edit
end
post '/update/:acct' do
client = HE_Backend.get(params[:acct])
client.attributes = {
:name => params['client']['name'],
:company => params['client']['company'],
:street => params['client']['street'],
:state => params['client']['state'],
:zip => params['client']['zip'],
:phone => params['client']['phone'],
:fax => params['client']['fax'],
:website => params['client']['website'],
:order_date => params['client']['order_date'],
:payment_date => params['client']['payment_date'],
:monthly => params['client']['monthly'],
:setup => params['client']['setup'],
:details => params['client']['details'],
:notes => params['client']['notes'],
:status => params['client']['status'],
}
if client.save
redirect "/show/#{client.acct}"
else
redirect('/list')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment