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?
On 2 March 2013 10:27, Shawn F. [email protected] 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
On 4 March 2013 06:12, Brentwood R. [email protected] wrote:
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
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 %>
so instead of rendering only the feeds from users you are
following(@feed_items), it renders them all.