活动管理员-从右到左筛选-表格滚动条-css/布局/结构更改

活动管理员-从右到左筛选-表格滚动条-css/布局/结构更改,css,filter,ruby-on-rails-3.2,activeadmin,Css,Filter,Ruby On Rails 3.2,Activeadmin,我在Rails上使用活动管理gem。我还没有做完所有的事 2澄清: 1. I want to display the filters section(:id => "filters_sidebar_section") to my left hand side. By default, this is displayed to my right hand side. 2. Can I limit the table width, so that a scroll bar is display

我在Rails上使用活动管理gem。我还没有做完所有的事

2澄清:

1. I want to display the filters section(:id => "filters_sidebar_section") to my left hand side. By default, this is displayed to my right hand side.
2. Can I limit the table width, so that a scroll bar is displayed at the bottom of the table and if my table has like 30 columns, I can use the scroll bar to reach the 30th column(Like you used to read this entire question)?

这个宝石可以阻止你管理边栏

使用activeadmin轻松更改侧栏位置(使用activeadmin~>1.0.0.pre测试)

添加css文件的包含

@import "active_admin_sidebar";
到app/assets/stylesheets/active_admin.css.scss

使用before_过滤器动态更改侧栏位置

# app/admin/posts.rb
ActiveAdmin.register Post do
  before_filter :left_sidebar!, only: [:show]
end

# app/admin/comments.rb
ActiveAdmin.register Comment do
  before_filter :right_sidebar!
end
在所有资源中向左移动侧栏(config/initializers/active_admin.rb)

禁用在仪表板上使用边栏布局(如果使用初始值设定项设置边栏位置)


想解释一下为什么要投否决票吗?在过去的两天里,我一直在用谷歌搜索这个。。我找不到答案。。我把它贴在这里,我得到了否决票?这太疯狂了!!我没有投反对票,但人们可能不会觉得为了说明一个观点而水平滚动很可爱。我想你喜欢它。嗨,贝克,我也有同样的问题。你是怎么决定的。?我想让筛选值从右到左显示。虽然这个链接可以回答这个问题,但最好在这里包含答案的基本部分,并提供链接供参考。如果链接页面发生更改,则仅链接的答案可能无效。@MathieuF,添加了详细的用法示例
# app/admin/posts.rb
ActiveAdmin.register Post do
  before_filter :left_sidebar!, only: [:show]
end

# app/admin/comments.rb
ActiveAdmin.register Comment do
  before_filter :right_sidebar!
end
# == Controller Filters
#
# You can add before, after and around filters to all of your
# Active Admin resources from here.
#
config.before_filter do
  left_sidebar! if respond_to?(:left_sidebar!)
end
ActiveAdmin.register_page "Dashboard" do
  controller {skip_before_filter :left_sidebar!}
  #.....
end