如何限制只有讨论版成员才能发表文章

1.step 1: app/views/groups/show.html.erb
找到这一行,“<%= link_to("Write a Post", new_group_post_path(@group), class: "btn btn-primary pull-right") %>”
并按图片做如下限制:

2.step 2:
刷新网页,就可以得到如下效果,即只有是讨论版成员,才会显示”write a post“按钮。

Comments

comments powered by Disqus