autocmd BufWritePre * :%s/\s\+$//e
(add-hook 'before-save-hook 'delete-trailing-whitespace)
| def address(separator, seperator2=' ') | |
| fields_array = %w(address1 address2 city state zip phone).map {|t| [:billing,t].join('_').to_sym} | |
| (0..10).inject("") { |string, i| | |
| if i.odd? | |
| field = :seperator | |
| field = (field.to_s + '2').intern if i == 7 | |
| else | |
| field = fields_array[i/2] | |
| end | |
| temp = send(field) rescue nil |
| # Used to modify the relationship tags applied to the specified contact | |
| # | |
| # PUT /users/bob/contacts/alice/tags?friend=t&family=f | |
| # | |
| # Sets the tags on the relationship that 'bob' has with 'alice' to be 'friend' and not 'family' | |
| # | |
| def tags | |
| @contact = user.contacts.with_login( params[:id] ) | |
| @relationship = user.relationships.with( @contact ) | |
| @relationship.set( tags_from_params( params ) ) |