Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Change instructions on actions in README.

  • Loading branch information...
commit 0f9daffaef630bbf57a9932b4cb16e2d6cead290 1 parent 722b764
@bobbytables authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 lib/generators/templates/table.rb
View
7 lib/generators/templates/table.rb
@@ -1,4 +1,7 @@
class <%= class_name %>Table < TableCloth::Base
+ # To include actions on this table, uncomment this line
+ # include TableCloth::Extensions::Actions
+
# Define columns with the #column method
# column :name, :email
@@ -22,8 +25,12 @@ class <%= class_name %>Table < TableCloth::Base
# Actions give you the ability to create a column for any actions you'd like to provide.
# Pass a block with an arity of 2, (object, view context).
# You can add as many actions as you want.
+ # Make sure you include the actions extension.
#
# actions do
# action {|object| link_to "Edit", edit_object_path(object) }
+ # action(if: :valid?) {|object| link_to "Invalidate", invalidate_object_path(object) }
# end
+ #
+ # If action provides an "if:" option, it will call that method on the object. It can also take a block with an arity of 1.
end
Please sign in to comment.
Something went wrong with that request. Please try again.