Skip to content

Instantly share code, notes, and snippets.

@tamouse
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tamouse/5d2431f4fc808c4d0951 to your computer and use it in GitHub Desktop.
Save tamouse/5d2431f4fc808c4d0951 to your computer and use it in GitHub Desktop.
passing a block to link_to or button_to, using bootstrappy goodnesses
<%= link_to edit_article_path(article), class: "btn btn-default" do -%>
<i class="glyphicon glyphicon-pencil"></i> Edit
<% end -%>
<%= button_to destroy_article_path(article), class: "btn btn-danger", method: "delete"
data: {confirm: "Are you sure?"}} do -%>
<i class="glyphicon glyphicon-delete"></i> Delete
<% end -%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment