1

simple_form gem で Twitter ブートストラップ スタイルを使用するために、次のフォームをセットアップしました。ただし、以下に示すように、「wrapper_html」コマンドはコンパイルされた css に表示され、Twitter ブートストラップ スタイルは適用されていません。誰が何が悪いのか知っていますか?

<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 => 'youremail@example.com', :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;}">
4

1 に答える 1

2

答えは、submit は入力ではないので :wrapper_html を使用しないということです。

クラスと ID は、このように直接渡す必要があります。

<%= f.submit "Get an invite", :class => 'btn.btn-primary', :id => "invitation_button"  %>
于 2012-08-20T01:04:54.540 に答える