css - 事件管理 - 从右到左过滤 - 表格滚动条 - css/布局/结构更改

标签 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 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)?

最佳答案

这个 gem 可以帮助你管理侧边栏 https://github.com/Fivell/active_admin_sidebar

gem install active_admin_sidebar

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

添加 css 文件的包含

@import "active_admin_sidebar";

到app/assets/stylesheets/active_admin.css.scss

使用 before_filter 动态更改侧边栏位置

# 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)

# == 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

关于css - 事件管理 - 从右到左过滤 - 表格滚动条 - css/布局/结构更改,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17400802/

相关文章:

javascript - 在响应式粘性导航栏中更改汉堡包图标的颜色

javascript - 选中复选框时将文本更改为正常

CSS alpha 不透明度 IE8 溢出被隐藏

mysql - 思考狮身人面像或条件

CSS:比容器宽的水平居中图形/图像

html - 在盒子里写 Markdown

filter - O数据 : Operands of logical operator 'AND' are not valid

c++ - QDir.setNameFilter 如何仅显示具有特定扩展名的文件?

ruby-on-rails - 是:on => :create valid for a before_save callback in Rails 3. 2.3

ruby-on-rails - belongs_to 关联即使在急切加载后也单独加载