Skip to content

Commit 833131d

Browse files
committed
Use local variables notation in partials
1 parent fd9d33a commit 833131d

8 files changed

Lines changed: 11 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## [2.0.9]
4+
5+
* Use new Rails 7.1 `locals` notation in ERB partials
6+
37
## [2.0.8]
48

59
* Rescue StatementInvalid when guessing column type from a query

app/views/datagrid/_enum_checkboxes.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<%# locals: (form:, elements:, choices:, filter:, options: {}) -%>
12
<%#
23
Indent in this file may cause extra space to appear.
34
You can add indent if whitespace doesn't matter for you

app/views/datagrid/_form.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<%# locals: (grid:, options: {}) -%>
12
<%= form_with model: grid, html: {class: 'datagrid-form'}, scope: grid.param_name, method: :get, **options do |f| %>
23
<% grid.filters.each do |filter| %>
34
<div class="datagrid-filter" data-filter="<%= filter.name %>" data-type="<%= filter.type %>">

app/views/datagrid/_head.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<%# locals: (grid:, options: {}) -%>
12
<tr>
23
<% grid.html_columns(*options[:columns]).each do |column| %>
34
<%= tag.th(

app/views/datagrid/_order_for.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<%# locals: (grid:, column:) -%>
12
<div class="order">
23
<%= link_to(
34
I18n.t("datagrid.table.order.asc").html_safe,

app/views/datagrid/_range_filter.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<%# locals: (form:, filter:, from_options: {}, to_options: {}) -%>
12
<%= form.datagrid_filter_input(filter, class: 'datagrid-range-from', **from_options) %>
23
<span class="datagrid-range-separator"><%= I18n.t('datagrid.filters.range.separator') %></span>
34
<%# Generating id only for "from" input to make sure -%>

app/views/datagrid/_row.html.erb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<%# locals: (grid:, asset:, options: {}) -%>
12
<tr>
23
<% grid.html_columns(*options[:columns]).each do |column| %>
34
<%= tag.td(

app/views/datagrid/_table.html.erb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<%#
2-
Local variables:
3-
* grid - instance of Datagrid
4-
* assets - Array of database Entities
5-
* options - passed options Hash
6-
%>
1+
<%# locals: (grid:, assets:, options: {}) -%>
72
<% if grid.html_columns(*options[:columns]).any? %>
83
<%= tag.table class: 'datagrid-table', **options.fetch(:html, {}) do %>
94
<thead>

0 commit comments

Comments
 (0)