Skip to content

Instantly share code, notes, and snippets.

@joncode
Created April 27, 2012 03:17
Show Gist options
  • Save joncode/2505387 to your computer and use it in GitHub Desktop.
Save joncode/2505387 to your computer and use it in GitHub Desktop.
adding params to link_to
using link_to via AJAX to update quantities on a form ... here is the code that passes the new quantity amount ...
<%= link_to ' ^ ', line_item_path(line_item, :amount => 1),
method: :put,
remote: true %>
NOTE - this will NOT work without the object (line_item) in the parenths with the :amount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment