【发布时间】:2019-12-23 04:25:01
【问题描述】:
我试图让我的 TODO 列表能够在同一页面上进行动态编辑。我的想法是使用 simple_form 来显示信息并隐藏边框。我需要集中显示的文本。但是,我在样式方面遇到了困难,因为没有显示任何内容。我想知道这是否可能?或者有没有更好的方法让我的 TODO 能够在不转到另一个页面表单的情况下进行编辑。
<div class = "border_show">
<%= simple_form_for @item do |f| %>
<%= f.input :title, label: false, required: true, :class => "form_border" %>
<%= f.input :description, label: false %>
<%= f.input :category, label: false %>
<%= f.button :submit, 'submit', :style => "display: none;" %>
<% end %>
<%= link_to "Back", root_path %>
<%= link_to "Delete", item_path(@item), method: :delete, data: {confirm: "Are you sure?"} %>
</div>
border_show是为造型创建边框:
.border_show{
padding-left: 20px;
padding-right: 20px;
font-family: Bookman, URW;
color: black;
background-color: rgba(255, 255, 255, 0.701);
width: 50%;
display: block;
margin-left: auto;
margin-right: auto;
border-radius: 25px;
}
.form_border{
border-style: none;
text-align: center;
}
我尝试将 form_border 的类替换为 id,但也没有用。
【问题讨论】:
标签: css ruby-on-rails forms simple-form simple-form-for