So what''s the ''right'' way to deal with AJAXY validators under REST? Say I have an observe_field that checks against taken usernames, where do I stick the available_user method? ... it doesn''t seem to fit in the RESTful user_controller, do I just create another controller to store all my AJAX cruft that is non-REST, or is there a more official/sanctioned/opinionated way to do this? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Wednesday 14 March 2007, Fluffy Hippo wrote:> So what''s the ''right'' way to deal with AJAXY validators under REST?Put them in the controller that handles the resource.> Say I have an observe_field that checks against taken usernames, > where do I stick the available_user method? ... it doesn''t seem to > fit in the RESTful user_controller,REST is a guideline, not a straitjacket. Michael -- Michael Schuerig mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org http://www.schuerig.de/michael/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Mar 14, 9:01 am, "Fluffy Hippo" <fluffyhi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> So what''s the ''right'' way to deal with AJAXY validators under REST? > > Say I have an observe_field that checks against taken usernames, where do I > stick the available_user method? ... it doesn''t seem to fit in the RESTful > user_controller, do I just create another controller to store all my AJAX > cruft that is non-REST, or is there a more official/sanctioned/opinionated > way to do this?What would available_user do? My guess is, given a potential user name, see if a user with than name already exists, right? In that case, perhaps your ajax call would just call myapp.com/users? name=''potential_name'' and see if you get a 404 back (no user found) or a 200 (which could mean that the user was found). This way you''re still RESTful, just look for query parameters that help refine your query. Would that work? Jeff softiesonrails.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---