Shawn Francis
2013-Mar-02 10:27 UTC
Following railstutorial.org tutorial, how to make the microposts be seen by all?
I am a new learner of Ruby on Rails. I followed through the railstutorial.org tutorial and I''m trying to learn off the sample demo app where you can to make microposts and only the people who are "following" you can see them. If I wanted to make it so every user can see microposts as an additional functionality, what are the steps to do that? -- 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 unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Colin Law
2013-Mar-02 13:26 UTC
Re: Following railstutorial.org tutorial, how to make the microposts be seen by all?
On 2 March 2013 10:27, Shawn Francis <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I am a new learner of Ruby on Rails. > I followed through the railstutorial.org tutorial and I''m trying to > learn off the sample demo app where you can to make microposts and only > the people who are "following" you can see them. > If I wanted to make it so every user can see microposts as an additional > functionality, what are the steps to do that?Have you worked right through the tutorial? I mean actually worked through it doing the examples. Which bits of the new functionality do you not know how to do? Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.
Brentwood Reid
2013-Mar-04 06:12 UTC
Re: Following railstutorial.org tutorial, how to make the microposts be seen by all?
> > I am also a new user and I had the same question. The way I did it was to > modify the file app/views/shared/_feed.html.erbchanging <%= render partial: ''shared/feed_item'', collection: @feed_items %> to <%= render partial: ''shared/feed_item'', collection: Micropost.all %> so instead of rendering only the feeds from users you are following(@feed_items), it renders them all. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/e9QLrc8xmcIJ. For more options, visit https://groups.google.com/groups/opt_out.
Colin Law
2013-Mar-04 09:58 UTC
Re: Re: Following railstutorial.org tutorial, how to make the microposts be seen by all?
On 4 March 2013 06:12, Brentwood Reid <bwoodreid-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:>> I am also a new user and I had the same question. The way I did it was to >> modify the file app/views/shared/_feed.html.erb > > > changing > <%= render partial: ''shared/feed_item'', collection: > @feed_items %> > > to > <%= render partial: ''shared/feed_item'', collection: > Micropost.all %>I assumed that the OP wanted this feature in addition to the existing capabilities rather than instead of. If however that is what he wants then it would be better to change the definition of @feed_items in the controller rather than changing it in the view. Colin> > so instead of rendering only the feeds from users you are > following(@feed_items), it renders them all. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To view this discussion on the web visit > https://groups.google.com/d/msg/rubyonrails-talk/-/e9QLrc8xmcIJ. > > For more options, visit https://groups.google.com/groups/opt_out. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.