Adding Button to View

/ Published in: Ruby
Save to your folder(s)

Adds a button in view, which triggers a method.

"Empty cart" is the button name
empty_cart is the method name

Copy this code and paste it in your HTML
  1. <%= button_to "Empty cart", :action => :empty_cart %>

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.