Use keyword arguments in tag methods
The interface of this method has changed and uses keyword arguments instead of a hash of options. This change will be particularly significant when upgrading to Ruby 3.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
<%= tag.table options do %>
|
<%= tag.table(**options) do %>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><%= t("admin.poll_officers.officer.name") %></th>
|
<th><%= t("admin.poll_officers.officer.name") %></th>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<div class="small-12 medium-4 column">
|
<div class="small-12 medium-4 column">
|
||||||
<%= tag.p(options) do %>
|
<%= tag.p(**options) do %>
|
||||||
<%= text %> <br><span class="number"><%= amount %></span>
|
<%= text %> <br><span class="number"><%= amount %></span>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
<%= tag.ul(options) { safe_join(list_items, "\n") } %>
|
<%= tag.ul(**options) { safe_join(list_items, "\n") } %>
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class Shared::LinkListComponent < ApplicationComponent
|
|||||||
|
|
||||||
def list_items
|
def list_items
|
||||||
present_links.map do |text, url, current = false, **link_options|
|
present_links.map do |text, url, current = false, **link_options|
|
||||||
tag.li(({ "aria-current": true } if current)) do
|
tag.li("aria-current": (true if current)) do
|
||||||
if url
|
if url
|
||||||
link_to text, url, link_options
|
link_to text, url, link_options
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ module StatsHelper
|
|||||||
def chart_tag(opt = {})
|
def chart_tag(opt = {})
|
||||||
opt[:data] ||= {}
|
opt[:data] ||= {}
|
||||||
opt[:data][:graph] = admin_api_stats_path(chart_data(opt))
|
opt[:data][:graph] = admin_api_stats_path(chart_data(opt))
|
||||||
tag.div opt
|
tag.div(**opt)
|
||||||
end
|
end
|
||||||
|
|
||||||
def chart_data(opt = {})
|
def chart_data(opt = {})
|
||||||
@@ -26,7 +26,7 @@ module StatsHelper
|
|||||||
def budget_investments_chart_tag(opt = {})
|
def budget_investments_chart_tag(opt = {})
|
||||||
opt[:data] ||= {}
|
opt[:data] ||= {}
|
||||||
opt[:data][:graph] = admin_api_stats_path(budget_investments: true)
|
opt[:data][:graph] = admin_api_stats_path(budget_investments: true)
|
||||||
tag.div opt
|
tag.div(**opt)
|
||||||
end
|
end
|
||||||
|
|
||||||
def number_to_stats_percentage(number, options = {})
|
def number_to_stats_percentage(number, options = {})
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ module TranslatableFormHelper
|
|||||||
|
|
||||||
def fields_for_locale(locale)
|
def fields_for_locale(locale)
|
||||||
fields_for_translation(@translations[locale]) do |translations_form|
|
fields_for_translation(@translations[locale]) do |translations_form|
|
||||||
@template.tag.div translations_options(translations_form.object, locale) do
|
@template.tag.div **translations_options(translations_form.object, locale) do
|
||||||
@template.concat translations_form.hidden_field(
|
@template.concat translations_form.hidden_field(
|
||||||
:_destroy,
|
:_destroy,
|
||||||
value: !@template.enabled_locale?(translations_form.object.globalized_model, locale),
|
value: !@template.enabled_locale?(translations_form.object.globalized_model, locale),
|
||||||
|
|||||||
Reference in New Issue
Block a user