Hello my friends! I was wondering if you can point me in the right direction. I have a controller that renders a page that I want to be able to call and include in other pages (including pages from other controllers) how would you recommend I go about doing that? For some odd reason I feel partials is not made for this. Am I wrong? How should I do it? Thanks for you guidance. John Kopanas john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org
John, Look into components. See this page on the WIKI: http://wiki.rubyonrails.com/rails/show/UnderstandingComponents For example, I am working on a collaboration application and I use a component to create a projects list pulldown. If I used a partial, then I would need to have every controller pass the @projects collection to the view. - Derek http://itsderek23.blogspot.com On 5/19/05, John Kopanas <john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org> wrote:> Hello my friends! > > I was wondering if you can point me in the right direction. > > I have a controller that renders a page that I want to be able to > call and include in other pages (including pages from other > controllers) how would you recommend I go about doing that? For some > odd reason I feel partials is not made for this. Am I wrong? How > should I do it? > > Thanks for you guidance. > > John Kopanas > john-Iau1QiYlxLpBDgjK7y7TUQ@public.gmane.org > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
If your only using the controller as a component on a page, wouldn''t it work just as well to make it an application helper? What issues help lead you toward a component or a helper? On 5/19/05, Derek Haynes <derek.haynes-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> John, > > Look into components. > > See this page on the WIKI: > http://wiki.rubyonrails.com/rails/show/UnderstandingComponents > > For example, I am working on a collaboration application and I use a > component to create a projects list pulldown. If I used a partial, > then I would need to have every controller pass the @projects > collection to the view. > > - Derek > http://itsderek23.blogspot.com