如何在Rails导入期间添加微调器图标

时间:2015-09-01 14:25:23

标签: ruby-on-rails twitter-bootstrap

我有一个电子表格导入程序,并希望在加载数据时显示某种图标。提交按钮原样是:

<%= f.submit "Import", :class => 'btn btn-primary'%>

我尝试使用bootstrap,但它似乎不起作用,代码看起来像:

<button type="button"
        class="btn btn-primary start"
        id="btnStartUploads"
        data-loading-text="<i class='icon-spinner icon-spin icon-large'></i> ">
    <i class="icon-upload icon-large"></i>
    <span><%= f.submit "Import"%>Import</span>
</button>

1 个答案:

答案 0 :(得分:0)

你能试试吗?我想这应该有用。

<%= f.submit "<i class="icon-upload icon-large"></i><span>Import</span>".html_safe, class: 'btn btn-primary start', id: id="btnStartUploads", "data-loading-text" => 'icon-spinner icon-spin icon-large' %>