From abe7f086b61175ab3e44d943a1fa781ed66e6112 Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 6 Jan 2020 01:56:16 -0600 Subject: [PATCH] table builder: eliminate is_html_safe flag. --- app/logical/table_builder.rb | 5 ++--- app/views/post_versions/_listing.html.erb | 2 +- app/views/table_builder/_table.html.erb | 6 +----- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/logical/table_builder.rb b/app/logical/table_builder.rb index d9884cf8c..7260fd33d 100644 --- a/app/logical/table_builder.rb +++ b/app/logical/table_builder.rb @@ -1,13 +1,12 @@ class TableBuilder class Column - attr_reader :attribute, :name, :block, :header_attributes, :body_attributes, :is_html_safe + attr_reader :attribute, :name, :block, :header_attributes, :body_attributes - def initialize(attribute = nil, header_attributes=nil, body_attributes=nil, is_html_safe=false, &block) + def initialize(attribute = nil, header_attributes=nil, body_attributes=nil, &block) @attribute = attribute @header_attributes = header_attributes @body_attributes = body_attributes @name = attribute.kind_of?(String) ? attribute : attribute.to_s.titleize - @is_html_safe = is_html_safe @block = block end diff --git a/app/views/post_versions/_listing.html.erb b/app/views/post_versions/_listing.html.erb index a0538e320..4fe37b168 100644 --- a/app/views/post_versions/_listing.html.erb +++ b/app/views/post_versions/_listing.html.erb @@ -5,7 +5,7 @@ <%= table_for @post_versions, {id: "post-versions-table", class: "striped autofit"} do |t| %> <% if CurrentUser.user.is_builder? %> - <% t.column "", {class: "post-version-select-column"}, nil, true do |post_version| %> + <% t.column tag.label(tag.input type: :checkbox, id: "post-version-select-all-checkbox", class: "post-version-select-checkbox"), { class: "post-version-select-column" } do |post_version| %> > <% end %> <% end %> diff --git a/app/views/table_builder/_table.html.erb b/app/views/table_builder/_table.html.erb index 6e9e03310..05f5a9f53 100644 --- a/app/views/table_builder/_table.html.erb +++ b/app/views/table_builder/_table.html.erb @@ -3,11 +3,7 @@ <% table.columns.each do |column| %> <%= tag.th column.header_attributes do %> - <% if column.is_html_safe %> - <%= column.name.html_safe %> - <% else %> - <%= column.name %> - <% end %> + <%= column.name %> <% end %> <% end %>