I generated Action Mailer when I access my method inside mailer then showing me this error

84 Views Asked by At

Showing /home/abidullah/.rvm/gems/ruby-2.7.0@eyesol/gems/railties-6.0.3.6/lib/rails/templates/rails/mailers/email.html.erb where line #102 raised:

Do not interpolate String in a tag. Instead of <option <%= request.format == Mime[:html] ? 'selected' : '' %>> please try <option <%= html_attributes(attr: value) %>>. Extracted source (around line #74): 72 73 74 75 76 77

      unless value.is_a?(BetterHtml::HtmlAttributes)
        raise DontInterpolateHere, "Do not interpolate #{value.class} in a tag. "\
          "Instead of <#{@context[:tag_name]} <%=#{@code}%>> please "\
          "try <#{@context[:tag_name]} <%= html_attributes(attr: value) %>>."
      end
1

There are 1 best solutions below

0
Abid Ullah On

We can not use conditional statement inside HTML tags I just remove <%= request.format == Mime[:html] ? 'selected' : '' %> from inside option tag and it's worked for me.