Skip to content

Commit

Permalink
Change instructions on actions in README.
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbytables committed Dec 25, 2012
1 parent 722b764 commit 0f9daff
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/generators/templates/table.rb
@@ -1,4 +1,7 @@
class <%= class_name %>Table < TableCloth::Base 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 # Define columns with the #column method
# column :name, :email # column :name, :email


Expand All @@ -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. # 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). # Pass a block with an arity of 2, (object, view context).
# You can add as many actions as you want. # You can add as many actions as you want.
# Make sure you include the actions extension.
# #
# actions do # actions do
# action {|object| link_to "Edit", edit_object_path(object) } # action {|object| link_to "Edit", edit_object_path(object) }
# action(if: :valid?) {|object| link_to "Invalidate", invalidate_object_path(object) }
# end # 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 end

0 comments on commit 0f9daff

Please sign in to comment.