Hi I have a rhtml documment in views/account/login.rhtml I want to include the contents of login.rhtml in views/welcome/index.rhtml any suggestions on how this can be done? Thanks Scott -- Posted via http://www.ruby-forum.com/.
Turn the shared content into a partial. Google ruby rails partials and I''m sure you''ll see a ton of demonstrations. Charlie Bowman www.recentrambles.com On Wed, 2006-04-19 at 18:11 +0200, Scott Sherwood wrote:> Hi > > I have a rhtml documment in views/account/login.rhtml > > I want to include the contents of login.rhtml in > views/welcome/index.rhtml > > any suggestions on how this can be done? > > Thanks > Scott >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060419/abea6c4e/attachment-0001.html
Daniel Higginbotham
2006-Apr-19 16:54 UTC
[Rails] include contents of one rhtml in another
I believe this can also be done by using render_component - though if you want to render a login box you''ll probably want to use a partial. -----Original Message----- From: rails-bounces@lists.rubyonrails.org [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Scott Sherwood Sent: Wednesday, April 19, 2006 6:11 AM To: rails@lists.rubyonrails.org Subject: [Rails] include contents of one rhtml in another Hi I have a rhtml documment in views/account/login.rhtml I want to include the contents of login.rhtml in views/welcome/index.rhtml any suggestions on how this can be done? Thanks Scott -- Posted via http://www.ruby-forum.com/. _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails
You could use a component if you wished. A partial is faster, if you can use it. On Wed, 2006-04-19 at 06:53 -1000, Daniel Higginbotham wrote:> I believe this can also be done by using render_component - though if you > want to render a login box you''ll probably want to use a partial. > > -----Original Message----- > From: rails-bounces@lists.rubyonrails.org > [mailto:rails-bounces@lists.rubyonrails.org] On Behalf Of Scott Sherwood > Sent: Wednesday, April 19, 2006 6:11 AM > To: rails@lists.rubyonrails.org > Subject: [Rails] include contents of one rhtml in another > > Hi > > I have a rhtml documment in views/account/login.rhtml > > I want to include the contents of login.rhtml in > views/welcome/index.rhtml > > any suggestions on how this can be done? > > Thanks > Scott >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060419/46ab6f1f/attachment.html