Skip to content

Commit

Permalink
Improve initializer template
Browse files Browse the repository at this point in the history
Suggest to use `Regexp#match?` instead of `string =~ Regexp`
  • Loading branch information
tagliala committed Nov 17, 2023
1 parent 9e7a1f0 commit d6b82cd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# <label for="#{instance.send(:tag_id)}" class="message"></label>
#
# ActionView::Base.field_error_proc = proc do |html_tag, instance|
# if html_tag =~ /^<label/
# if /^<label/.match?(html_tag)
# %(<div class="field_with_errors">#{html_tag}</div>).html_safe
# else
# %(<div class="field_with_errors">#{html_tag}<label for="#{instance.send(:tag_id)}" class="message">#{instance.error_message.first}</label></div>).html_safe
Expand Down

0 comments on commit d6b82cd

Please sign in to comment.