aboutsummaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorTeddy Wing2017-06-15 16:42:42 +0200
committerTeddy Wing2017-06-15 16:42:42 +0200
commit73f8e3bb8a5e6ac47874ce75ed3bf81c63a633dd (patch)
tree3f76da385bad40a6e04fef336fbb414cebccd5f7 /app/helpers
parentb011960b67c7cadecb8d948934f13071d9ae4df1 (diff)
downloadchouette-core-73f8e3bb8a5e6ac47874ce75ed3bf81c63a633dd.tar.bz2
TableBuilderHelper#table_builder_2: Clean up arguments & add docs
Remove unnecessary arguments and document the ones we are using. `current_referential` has been removed. Ultimately decided that it was simpler to just rely on the existing method that's magically "imported" instead of passing it directly. If you vote to pass it in as an arg, though, I'm all for it. Refs #3479
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/table_builder_helper.rb19
1 files changed, 8 insertions, 11 deletions
diff --git a/app/helpers/table_builder_helper.rb b/app/helpers/table_builder_helper.rb
index 01e2e6fad..111237a7b 100644
--- a/app/helpers/table_builder_helper.rb
+++ b/app/helpers/table_builder_helper.rb
@@ -9,22 +9,19 @@ module TableBuilderHelper
def table_builder_2(
collection,
columns,
- current_referential: nil,
# When false, no columns will be sortable
sortable: true,
+ # When true, adds a column of checkboxes to the left side of the table
selectable: false,
- # selection_actions: [] ## this has been gotten rid of. The element based on this should be created elsewhere
- links: [], # links: or actions: ? I think 'links' is better since 'actions' evokes Rails controller actions and we want to put `link_to`s here
- # TODO: get rid of this argument. Going with params instead
- sort_by: {}, # { column: 'name', direction: 'desc' }
- cls: '' # can we rename this to "class"?
- # ^^ rename to html_options = {} at the end of the non-keyword arguments? Hrm, not a fan of combining hash args and keyword args
-# sort column
-# sort direction
-
-# TODO: add `linked_column` or some such attribute that defines which column should be linked and what method to call to get it
+
+ # A set of controller actions that will be added as links to the top of the
+ # gear menu
+ links: [],
+
+ # A CSS class to apply to the <table>
+ cls: ''
)
content_tag :table,