On Miércoles, 8 de Septiembre de 2010 18:31:15 Michael Bahnmiller escribió: > So, let's say I have the following relationship: > > Service > Id > ServiceCategory > Id > ServiceCategoryMembership > Id > ServiceId > ServiceCategoryId > ServiceRestriction > ServiceId > RestrictedServiceId (ServiceId for the restriction) > > I'm on the Service Categories page. I click on the column for Services > to bring up the sub-grid Services. (Done :through > ServiceCategoryMembership). > > Then I click on the ServiceRestrictions column for a given Service. > This brings up a list of restricted services. > > I then click on Create New. In this Create New form, there is a field > for Restricted Services, which is set to use RecordSelect. > > I want this record_select to pull up ONLY those (restricted service) > records from the Service table that are not /already/ tied to this > particular service. This means that I need to get the ID of the Service > that I'm trying to Create New for. > > How can I go about doing that?
You can get the id with active_scaffold_constraints[:service] You will have to set options[:params] in a before filter to send that id in record_select search, so you can use that from record_select_conditions_from_controller. Or you can use a form helper override and set params in record_select_field. > > Thanks, > Mikelb > > On 09/08/2010 01:47 AM, Sergio Cambra .:: entreCables S.L. ::. wrote: > > On Miércoles, 8 de Septiembre de 2010 07:57:44 mikelb escribió: > >> How do I get a hold of the current association ID's when I'm inside > >> the record_select_conditions_from_controller? > >> > >> Many thanks, > >> Mikelb > > > > Sorry, I don't understand, what association id? > > record_select_conditions_from_controller is called from a record_select > > browse request, which is a collection route, without id. You will have > > request params in params hash -- Sergio Cambra .:: entreCables S.L. ::. Mariana Pineda 23, 50.018 Zaragoza T) 902 021 404 F) 976 52 98 07 E) [email protected] -- You received this message because you are subscribed to the Google Groups "ActiveScaffold : Ruby on Rails plugin" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/activescaffold?hl=en.
