I am using render to redirect to a page. If this page has errors they get displayed. There are a number of times where I have to call render. There are also a number of collections on the page @somecollection = SomeModel.find(:all) Currently i call each collection with each render statement. This results in a lot of repeat code. Is there a way to define a method that will be called each time the page is renderd? -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---
without more information a tactic is hard to provide. but note that render does not redirect (control). It allows you to, when in some controller C and action A to choose another .rhtml file to run rather than the default app/views/C/A.rhtml. To actually redirect control perform redirect_to .... You may also compose combine redirect_to and render. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---