Hi, I have two models post and video. How to combine their outputs and show it in a one page. Regards Suji A. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
There are numerous ways you could achieve it. Can you give more details for your particular needs ? Are the two models related ? Thanks & Regards, Dhruva Sagar. On Fri, Dec 4, 2009 at 11:12 AM, suji A <suji87.msc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I have two models post and video. How to combine their outputs and show it > in a one page. > > > > > > > Regards > Suji A. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
No the models not related. Just i create 1 application and create post,video models inside it,the post model contains the title, content and the video model contains the title,description,video file. i want to show the title,content of the post model and the video in one page. Regards, Suji A. On Fri, Dec 4, 2009 at 11:33 AM, Dhruva Sagar <dhruva.sagar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> There are numerous ways you could achieve it. Can you give more details for > your particular needs ? > Are the two models related ? > > Thanks & Regards, > Dhruva Sagar. > > > > > On Fri, Dec 4, 2009 at 11:12 AM, suji A <suji87.msc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Hi, >> >> I have two models post and video. How to combine their outputs and show it >> in a one page. >> >> >> >> >> >> >> Regards >> Suji A. >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, Obviously you can still have the post & the video content on the same page. But can you then explain the scenario that your trying to create ? For instance which video would you want to show in which post ? Logically it implies that they should be related and in the page where you display the POST you should be displaying the appropriate video that is related to that post... But in any case the relationship is not mandatory, if you still wish to show both the post data as well as the video data on the same page, then you can do that too. Assuming that your checking out the POST INDEX action you could have something like this in the index action of the POST controller : def index @posts = Post.all @videos = Video.all end and in the view you can then loop through these 2 models and display their content as you like... Thanks & Regards, Dhruva Sagar. On Fri, Dec 4, 2009 at 11:41 AM, suji A <suji87.msc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> No the models not related. Just i create 1 application and create > post,video models inside it,the post model contains the title, content and > the video model contains the title,description,video file. i want to show > the title,content of the post model and the video in one page. > > > Regards, > Suji A. > > > On Fri, Dec 4, 2009 at 11:33 AM, Dhruva Sagar <dhruva.sagar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: > >> There are numerous ways you could achieve it. Can you give more details >> for your particular needs ? >> Are the two models related ? >> >> Thanks & Regards, >> Dhruva Sagar. >> >> >> >> >> On Fri, Dec 4, 2009 at 11:12 AM, suji A <suji87.msc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> Hi, >>> >>> I have two models post and video. How to combine their outputs and show >>> it in a one page. >>> >>> >>> >>> >>> >>> >>> Regards >>> Suji A. >>> >>> -- >>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Thank you sir, i got some idea from this. Hereafter i can implement it in my application. The scenario for this is , i have to create one application that should have three part in a one page, in that the first part will show the recent post and the second part will show the video and the third part will show the older posts links. The post and the video are not dependent. Regards, Suji A. On Fri, Dec 4, 2009 at 12:30 PM, Dhruva Sagar <dhruva.sagar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote:> Hi, > > Obviously you can still have the post & the video content on the same page. > But can you then explain the scenario that your trying to create ? > > For instance which video would you want to show in which post ? Logically > it implies that they should be related and in the page where you display the > POST you should be displaying the appropriate video that is related to that > post... > > But in any case the relationship is not mandatory, if you still wish to > show both the post data as well as the video data on the same page, then you > can do that too. > > Assuming that your checking out the POST INDEX action you could have > something like this in the index action of the POST controller : > > > def index > @posts = Post.all > @videos = Video.all > end > > and in the view you can then loop through these 2 models and display their > content as you like... > > Thanks & Regards, > Dhruva Sagar. > > > > > > On Fri, Dec 4, 2009 at 11:41 AM, suji A <suji87.msc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> No the models not related. Just i create 1 application and create >> post,video models inside it,the post model contains the title, content and >> the video model contains the title,description,video file. i want to show >> the title,content of the post model and the video in one page. >> >> >> Regards, >> Suji A. >> >> >> On Fri, Dec 4, 2009 at 11:33 AM, Dhruva Sagar <dhruva.sagar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>wrote: >> >>> There are numerous ways you could achieve it. Can you give more details >>> for your particular needs ? >>> Are the two models related ? >>> >>> Thanks & Regards, >>> Dhruva Sagar. >>> >>> >>> >>> >>> On Fri, Dec 4, 2009 at 11:12 AM, suji A <suji87.msc-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> >>>> Hi, >>>> >>>> I have two models post and video. How to combine their outputs and show >>>> it in a one page. >>>> >>>> >>>> >>>> >>>> >>>> >>>> Regards >>>> Suji A. >>>> >>>> -- >>>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>>> To unsubscribe from this group, send email to >>>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >>>> . >>>> For more options, visit this group at >>>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>>> >>> >>> -- >>> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.