bobbytables/table_cloth — pull request #40 by mvdamme (2014-10-05 21:43:33+00:00)
Title: Modified treatment of conditionals in actions

This pull request is a proposed fix for issue #39.
When a condition for an action is provided as a symbol, the corresponding method is called on the table:
```ruby
class EventTable < TableCloth::Base
column :name

actions do
action(if: :admin?) {|object| link_to 'Delete', object, method: :delete }
end

def admin?
view.current_user.admin?
end
end
```

When a condition is provided as a proc or lambda, both the object and the table are passed in:
```ruby
class EventTable < TableCloth::Base
column :name

actions do
action(if: ->(object, table) { !object.read_only? }) {|object| link_to 'Delete', object, method: :delete }
end
end
```
I'm not sure wether this is the right choice for procs. As stated in #39, it is easy to add object dependent conditions inside the action block itself.

Please note that while this pull request makes the code consistent with the README, it might break existing applications that rely on the old behaviour.