More than 1 year has passed since last update.

link_toメソッド + icon をhaml化してみた

元のhogehoge.html.erb
<div class="btn-group" style="margin-left:10px; ">
<%= link_to new_user_registration_path, class: "btn btn-dark btn-sm" do %>
    <i class="fa fa-user" style="padding-right: 10px"></i>会員登録
<% end %>
</div>
生成されたhtml.haml
.btn-group{:style => "margin-left:10px; "}
  = link_to new_user_registration_path, class: "btn btn-dark btn-sm" do
    %i.fa.fa-user{:style => "padding-right: 10px"}>
    会員登録

erb=>hamlは下記を参考にさせていただいています。
http://qiita.com/m_doi/items/1f01fd2b1a52c2c43f1f

Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account log in.