Sign a loan feature for $50
New here? Learn about Bountify and follow @bountify to get notified of new bounties! x

Here's a story I'm looking to implement but not sure which is the best way to go about it.

Given Im on http://www.lendinground.com/notes/527a705db5c271e1d1000002
When I enter my name and click Sign & accept terms
Then I should be redirected to notes/:id but with the text input box replaced with my name. 

One way I thought about was

A.

Given I'm on notes/new, 
when I create a loan
then I'm redirected to notes/:id/edit

B.

Given I'm on notes/:id/edit
When i enter my name and click 'Sign'
Then I should be redirected to notes/:id with my name next to signature

Another way I thought about was

A.

Given I'm on notes/new, 
when I create a loan
then I'm redirected to notes/:id

B.

Given I'm on notes/:id
when i click 'Sign a loan'
then I'm redirected to notes/:id/edit

C.

Given I'm on notes/:id/edit
When I enter my name and click 'Agree'
Then I'm redirected to notes/:id

Here's the repo (its MIT licensed)
https://github.com/akshatpradhan/lending-round

Just send a PR with tests (very important), and I'll merge it in.

Thank you!

On a related note, I came across this neat little project the other day http://blog.ezliu.com/online-signatures/, might be useful for you.
alixaxel over 5 years ago
I really like this! Definitely a feature to think about in a later "sprint"
akshatpradhan over 5 years ago
The second way seems more natural to me but I would skip the B step by just updating the loan "signedbylender" field by clicking on the "Sign a loan" button on the backend.
kc00l over 5 years ago
awarded to kc00l

Crowdsource coding tasks.

1 Solution

Winning solution

Here is my pull request https://github.com/akshatpradhan/lending-round/pull/15

Summary of changes:

  1. Added fields for lender/borrower signatures and added them to the attr_accessible whitelist
  2. Removed double flash message container in notes#show view
  3. Notes#show view: changed note sign form to load the @note instance and to submit just the signed_by_lender/borrower fields.
  4. Notes#show view: don't load sign form if signed_by_lender/borrower field is already filled in
  5. Added specs to test borrower and lender sign and to check whether note sign forms are not rendered if note is already signed

Some things to discuss/add

  1. Borrower/Lender relationship with Note
  2. Allow the lender to edit the note
  3. Add a checkbox in the note sign form to allow a "Accept terms etc." feature
  4. Submit the note sign form with an AJAX request
Your PR/15 is live right now: http://www.lendinground.com
akshatpradhan over 5 years ago