remove better html html_attributes

pull/105/head
Alex Turchyn 2 years ago
parent 21f684ed4a
commit 878af5d250

@ -24,7 +24,7 @@ class ApplicationController < ActionController::Base
render_to_string(partial: 'shared/button_title', locals: { title:, disabled_with:, icon: })
end
def svg_icon(icon_name, options = {})
render_to_string(partial: "icons/#{icon_name}", locals: { attibutes: options })
def svg_icon(icon_name, class: '')
render_to_string(partial: "icons/#{icon_name}", locals: { class: })
end
end

@ -1,4 +1,4 @@
<svg <%= html_attributes(**local_assigns.fetch(:attibutes, {})) %> xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M12 3a9 9 0 1 0 9 9" />
</svg>

Before

Width:  |  Height:  |  Size: 342 B

After

Width:  |  Height:  |  Size: 317 B

@ -1,4 +1,4 @@
<svg <%= html_attributes(**local_assigns.fetch(:attibutes, {})) %> xmlns="http://www.w3.org/2000/svg" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<svg xmlns="http://www.w3.org/2000/svg" class="<%= local_assigns[:class] %>" width="44" height="44" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
<path d="M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2" />
<path d="M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" />

Before

Width:  |  Height:  |  Size: 482 B

After

Width:  |  Height:  |  Size: 457 B

@ -1,7 +1,5 @@
# frozen_string_literal: true
ActionView::Helpers.include(BetterHtml::Helpers)
if defined?(BetterHtml)
BetterHtml.configure do |config|
config.template_exclusion_filter = ->(filename) { filename.include?('/gems/') }

Loading…
Cancel
Save