【问题标题】:Rails Active Admin filterRails 活动管理员过滤器
【发布时间】:2014-05-29 14:30:58
【问题描述】:

我有三个模型产品类别,Heureka 产品被分配到一个类别,每个类别都可以选择映射到 heureka 全名。

我正在寻找如何在 category.category_name 或 heureka.fullname 上的活动管理产品页面上编写过滤器

class Category < ActiveRecord::Base
has_many :product
has_one :heureka
end


class Heureka < ActiveRecord::Base
  belongs_to :category
end


class Product < ActiveRecord::Base
  belongs_to :category
end

【问题讨论】:

    标签: ruby-on-rails-4 activeadmin nested-attributes


    【解决方案1】:

    ActiveAdmin 使用 Ransack gem 创建搜索表单作为过滤器。不幸的是,它没有很好的文档记录,您必须深入研究源代码。

    查看更多:https://github.com/activerecord-hackery/ransack

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-08-10
      相关资源
      最近更新 更多