在活动管理中对选定对象使用收集操作
我正在为我的 Rails 应用程序实现一个带有 Active Admin 的管理面板。
我在管理面板中有一个评论部分,我想通过检查我想要批准的评论然后单击更新按钮来批准一组评论。
在我以前版本的管理面板中,进行组更新的页面部分如下所示:
<%= form_tag(:controller => "admin/comments", :action => "update_statuses") do %>
<table>
<% @comments.each do |comment| %>
<tr>
<td><%= check_box_tag("comments[]", comment.id) %></td>
#More table cells with info about comment
</tr>
<%end%>
</table>
<%= select_tag "status", options_for_select(comment_statuses) %>
<%= submit_tag "Update" %>
<% end %>
如何在活动管理中获得类似的功能?
I am implementing an admin panel with Active Admin for my rails application.
I have a comment section inside admin panel, and I'd like to approve a group of comments by checking the comments I'd like to approve and then clicking update button.
In my previous version of admin panel part of page that did group updating looks like this:
<%= form_tag(:controller => "admin/comments", :action => "update_statuses") do %>
<table>
<% @comments.each do |comment| %>
<tr>
<td><%= check_box_tag("comments[]", comment.id) %></td>
#More table cells with info about comment
</tr>
<%end%>
</table>
<%= select_tag "status", options_for_select(comment_statuses) %>
<%= submit_tag "Update" %>
<% end %>
How to get similar functionality in active admin?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
现在活动管理员缺少这样的功能。如果您想使用备用 Rails 管理界面,那么 rails_admin 更适合此类功能。
Right now active admin is missing such a feature. If you want to go for alternate rails admin interface then rails_admin is much better for such kind of functionality.
目前正在 ActiveAdmin 的 master 分支中开发和引入批处理功能。这是它的样子。
http://dribbble.com/shots/265461-Active-Admin-Batch -编辑弹出框
Batch functionality is currently being worked on and introduced in the master branch of ActiveAdmin. Heres how it looks.
http://dribbble.com/shots/265461-Active-Admin-Batch-edit-popover