Created
February 19, 2010 04:06
-
-
Save cmhobbs/308408 to your computer and use it in GitHub Desktop.
This file contains 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
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