我正在使用Rails助手來生成按鈕,我試圖用按鈕的Twitter引導樣式來設置樣式。我已經添加了:html
選項。該網頁沒有中斷,但樣式沒有顯示出來。使用Twitter引導的樣式化Rails按鈕鏈接助手
<%= button_to('Sign Up', new_user_registration_path, :html => {:class => 'btn.btn-large.btn-primary'}) %>
<%= button_to "Sign Up", user_omniauth_authorize_path(:facebook), :html => {:class => 'btn.btn-large.btn-primary'} %>
這是Facebook的按鈕
<form action="https://stackoverflow.com/users/sign_up" class="button_to" method="post"><div><input html="{:class=>"btn.btn-large.btn-primary"}" type="submit" value="Sign Up" /><input name="authenticity_token" type="hidden" value="QIvZqd9BRV8TMspMvckAUjhC68nm3NTyQCxVRHFA4PE=" /></div></form>
<form action="https://stackoverflow.com/users/auth/facebook" class="button_to" method="post"><div><input html="{:class=>"btn.btn-large.btn-primary"}" type="submit" value="Sign Up" /><input name="authenticity_token" type="hidden" value="QIvZqd9BRV8TMspMvckAUjhC68nm3NTyQCxVRHFA4PE=" /></div></form>
任何知道我做錯了頁面的源代碼?
我已經更新了OP與一個圖像顯示如何類附加到輸入元素。任何線索? – Leahcim 2012-03-31 04:33:58
即它不起作用。 – Leahcim 2012-03-31 05:41:33
它需要類之間的空間:class =>'btn btn-large btn-success'它是這樣工作的。 – Leahcim 2012-03-31 06:51:14