美文网首页
2018-02-02 疑问

2018-02-02 疑问

作者: v178 | 来源:发表于2018-03-22 17:25 被阅读0次

    1、_form.html.erb里面
    <%= form_for @group do |f| -%><%= form_for @group do |f| %>一样,为什么???
    edit里也是这样,???
    2、before_action里,only:和:only => 一样。
    3、 /Users/v178/rails102/app/views/groups/show.html.erb
    <% if current_user && current_user == post.user %>
    <td><%= link_to("Edit", edit_group_post_path(post.group, post), class: "btn btn-default btn-xs") %></td>
    <td><%= link_to("Delete", group_post_path(post.group, post), method: :delete, data: { confirm: "Are you sure?"}, class: "btn btn-default btn-xs") %></td>
    <% end %>
    会没有白线,不知道原因。

    自己写的

    4、_form.html.erb里面
    , input_html: { class: "form-control"}
    删掉与否没有影响,为什么?

    相关文章

      网友评论

          本文标题:2018-02-02 疑问

          本文链接:https://www.haomeiwen.com/subject/aclszxtx.html