How can I write this in haml? (rails app)

<a href="/">
  <i class="material-icons">file_download</i>
  Export to CSV
</a>

I am using a material_icon gem. "file_download" is a download icon in a material icon. I want it to be like a button with the download icon and the text "Export to CSV" next to it.

1 answer

  • answered 2022-05-06 15:32 kouroubel

    Should be something like:

    = link_to foo_path do
      %i.material-icons file_download
      Export to CSV
    

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum