2012-08-20 51 views
1

我設置了以下表單來設置與simple_form gem一起使用Twitter引導程序的樣式。但是,正如您在下面看到的那樣,「wrapper_html」命令在編譯後的css中可見,並且Twitter引導程序樣式未被應用。有誰知道什麼是錯的?Rails gem simple_form - :wrapper_html顯示在已編譯的CSS中

<div class="formbox"> 
<h2>Sign Up To Hang Out With Some Losers<h2> 
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %> 
    <%= devise_error_messages! %> 
    <%= f.input :email, :label => false, :placeholder => '[email protected]', :wrapper_html => { :class => 'paddingmarg'} %> 

    <%= f.submit "Get an invite", :wrapper_html => { :class => 'btn.btn-primary', :id => "invitation_button" } %> 

    <% end %> 
</div> 

編譯CSS ....

<input name="commit" type="submit" value="Get an invite" wrapper_html="{:class=&gt;&quot;btn.btn-primary&quot;, :id=&gt;&quot;invitation_button&quot;}"> 

回答

2

答案是,提交不使用:wrapper_html因爲它不是輸入。

類和id應該直接像這樣傳遞。

<%= f.submit "Get an invite", :class => 'btn.btn-primary', :id => "invitation_button" %> 
相關問題