I have a small project running using ActiveScaffold sucesfully. As my next step I would like to modify things such that after a search is executed if the result is one record skip directly to the show of the record (show method?) and not the results screen normaly seen. Of course if the result is more than 1 record after searching (as is normal) then the default behavior can continue. Has anyone done this? Is it as simple as an ''if'' statement and a redirect? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Has anyone tackled this before? On Feb 12, 4:42 pm, agilehack <jason.rabo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I have a small project running using ActiveScaffold sucesfully. As my > next step I would like to modify things such that after a search is > executed if the result is one record skip directly to the show of the > record (show method?) and not the results screen normaly seen. Of > course if the result is more than 1 record after searching (as is > normal) then the default behavior can continue. Has anyone done > this? Is it as simple as an ''if'' statement and a redirect?--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
have you tried writing an index method that does the find, checks the result. If there is only one result, set this into a singular @object_name and then render show, or possibly setup params and then do a redirect I have done a little with ActiveScaffold and that is how where I would start, but I may be wide of the mark Tonypm --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---