Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
nested fields and search questions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Karl Baum  
View profile  
 More options Sep 11 2012, 7:34 am
From: Karl Baum <karl.b...@gmail.com>
Date: Tue, 11 Sep 2012 07:33:58 -0400
Local: Tues, Sep 11 2012 7:33 am
Subject: nested fields and search questions
Have a few rails_admin questions.  Think i know the answers but wanted to double check;

1)  Is it possible to add search filters by fields on nested models?  For example, property belongs to city which has a name.  Is it possible to filter properties by city#name?

2)  When exporting to CSV, is it possible to export fields from nested models two levels deep?  In my case, space belongs_to property which belongs to city.  I would like to export the city name.

3)  Is it possible to have search criteria joined together with "or" instead of "and".  For example, i want to search all users with name michael or jon.

thx!

-karl


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benoit Bénézech  
View profile  
 More options Sep 13 2012, 12:37 pm
From: Benoit Bénézech <benoit.benez...@gmail.com>
Date: Thu, 13 Sep 2012 09:37:03 -0700 (PDT)
Local: Thurs, Sep 13 2012 12:37 pm
Subject: Re: nested fields and search questions

1) yes :)

config.model Property do
  field city do
    searchable :name # or 'city.name' or  { City => :name }
  end
end

2) You can add custom fields that can behave the same

config.model Space do
  export do
    ....
    field property_city do
      export_value do
        bindings[:object].property.city.name
      end
    end
    ....
  end
end

3) no :( It would need a refactoring of the search engine and the filter
widgets... :/

Le mardi 11 septembre 2012 13:34:02 UTC+2, Karl a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Benoit Bénézech  
View profile  
 More options Sep 13 2012, 12:38 pm
From: Benoit Bénézech <benoit.benez...@gmail.com>
Date: Thu, 13 Sep 2012 09:38:59 -0700 (PDT)
Local: Thurs, Sep 13 2012 12:38 pm
Subject: Re: nested fields and search questions

For the second one, it's :property_city instead of property_city.
And you may need to add a few other methods if it complains.

Le jeudi 13 septembre 2012 18:37:03 UTC+2, Benoit Bénézech a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »