我正在尝试让我的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,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 ,但是它也不起作用。