ruby-on-rails – Rails 3.1 simple_form提交样式css

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – Rails 3.1 simple_form提交样式css前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
你有没有人知道如何添加一个类到simple_form提交按钮,对于css style.Here是我试图做的:

_form.html.erb

<%= simple_form_for(@drink) do |f| %>
 <%= f.submit "Add drink",:input_html =>{:class => "create"} %>
<%end%>

drinks.css.scss

.create {
    background-color:#2fd62f;
    -moz-border-radius:4px;
    -webkit-border-radius:4px;
    border-radius:4px;
    border:1px solid #dcdcdc;
    display:inline-block;
    color:#fafafa;
    font-family:arial;
    font-size:12px;
    font-weight:bold;
    padding:7px 24px;
    text-decoration:none;
    text-shadow:0px 0px 0px #70706f;
}.create:hover {
    background-color:#2fbf0f;
}.create:active {
    position:relative;
    top:1px;
}

解决方法

<%= f.submit“添加饮料”,:class => “创建”%>
原文链接:/ruby/271961.html

猜你在找的Ruby相关文章