El Friday 24 April 2009 05:35:36 dkindlund escribió: > Hi all, > > I'm trying to configure AS on a rails webapp to support RESTful > searching from an *external application* -- meaning, not through the > standard UI. > > So far, I've been able to get something like this working: > > GET, '/clients/1.json' > GET, '/clients/show/1.json' > > But, that doesn't help me, if the external application doesn't know > which database ID to reference. > > What I'm really looking for, is something like: > > GET, '/clients/search.json?search=StringToSearchOn' > > Where 'StringToSearchOn' would be the same data I could enter through > the search field's UI and the entire REST operation would return an > array of results (as expected). > > The problem is: it doesn't look like AS supports this out of the box. > For example, *all* the search related code I've found on the master > branch appears to be extremely UI specific and it wasn't intended for > RESTful use. However, I could be wrong, as I'm not an AS expert; if > AS does support this natively, could someone give me an example REST > syntax to use? > > If AS doesn't support this out of the box, could someone give me an > example about how I could extend my 'Clients' controller to support > this type of capability?
You can use GET, '/clients/list.json?search=StringToSearchOn' search is implemented as a before_filter, so you can use list action to search -- Sergio Cambra .:: entreCables S.L. ::. Nicolás Guillén 6, locales 2 y 3. 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 -~----------~----~----~----~------~----~------~--~---
