Advertisement
Guest User

Untitled

a guest
Oct 7th, 2015
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <%= link_to "Accept", accept_candidate_path(vacancy_id: @vacancy.id, employee_id: e.id), method: :post, :remote => true, :id => "link_#{i}" %>
  2.  
  3. <%= link_to "Cancel", back_to_pending_path(vacancy_id: @vacancy.id, employee_id: e.id), method: :post, :remote => true%>
  4.  
  5. $("[id^='link_']").click(function (event) {
  6. $(this).replaceWith("Accepted")
  7. });
  8.  
  9. # back_to_pending.js
  10. $("[id^='link_']").html("<%= escape_javascript(render('cancel_link')) %>")
  11.  
  12.  
  13. # cancel_link.html.erb
  14. <%= link_to "Cancel", back_to_pending_path(vacancy_id: @vacancy.id, employee_id: e.id), method: :post, :remote => true%>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement