Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard无法定义在attributes(resource)之外的searching attribute #32

Closed
nobrick opened this issue May 9, 2016 · 0 comments
Closed

Comments

@nobrick
Copy link
Owner

nobrick commented May 9, 2016

@hymRedemption 假设我希望在 Order Dashboard 中定义以下搜索属性:

  search("search_admin_orders_path") do |s|
    s.eq "id"
    s.eq "user.id"
    s.eq "handyman.id"

    # FIXME: There is no need to ensure the searching attributes are defined in
    # the `attributes("Order")` fields, since the latter is only used for
    # visually displaying explicit columns in the table of the index page.
    # Therefore we should allow the attributes not explicitly demonstrated in
    # the model attribute fields for searching purposes.

    s.eq "user.phone"
    s.eq "handyman.phone"
  end

因为后面两个 phone 属性未在 attributes("Order") 中得到定义,访问该页面时会抛出异常。这是不是不太符合预期呢?因为 attributes("Order") 中定义的是订单列表中显式展示的列,但搜索的属性应该可以不在其中,我觉得两者应该没有直接的关联。

@nobrick nobrick closed this as completed Apr 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant