Last active
August 29, 2015 14:04
-
-
Save derwiki/a24512f511db659020fe to your computer and use it in GitHub Desktop.
Generate a token and add the parameter to the link.
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
diff --git a/app/mailers/reservation_mailer.rb b/app/mailers/reservation_mailer.rb | |
index 4ee2db4..0f8faf2 100644 | |
--- a/app/mailers/reservation_mailer.rb | |
+++ b/app/mailers/reservation_mailer.rb | |
@@ -16,6 +16,8 @@ class ReservationMailer < CameraLendsMailer | |
def reservation_request_lender(reservation) | |
@reservation = reservation | |
+ @owner = reservation.item.owner | |
+ @owner.new_token! | |
item = reservation.item.decorate | |
mail to: reservation.item.owner.email_for_mailer, | |
subject: "Reservation request for #{ item.display_name }" | |
diff --git a/app/views/reservation_mailer/reservation_request_lender.html.haml b/app/views/reservation_mailer/reservation_request_lender.html.haml | |
index b3ff043..54f4712 100644 | |
--- a/app/views/reservation_mailer/reservation_request_lender.html.haml | |
+++ b/app/views/reservation_mailer/reservation_request_lender.html.haml | |
@@ -47,7 +47,7 @@ | |
okay, but don't leave #{ renter.first_name } hanging! | |
%p | |
- = btn_email 'Respond now »', reservation_url(@reservation) | |
+ = btn_email 'Respond now »', reservation_url(@reservation, token: @owner.token) | |
%p | |
Easy-peesy. After accepting, the renter will pay to finalize the |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment