Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4 | 5 | 6 | 7|Last
Lessons:- A Proto-feed

 

The status feed partial defers the feed item rendering to a feed item partial using the code

<%= render partial: 'shared/feed item', collection: @feed items %>

 

Here we pass a :collection parameter with thefeed items, which causes render to use the given partial s(’feed_item’ in this cae) to render each item in the collection. (We have omitted the :partial parameter in previous renderings, writing, e.g., render ’shared/micropost’, but with a :collection parameter that syntax doesn’t work.) The feed item partial itself appears in Listing 10.43.

 

 

 

Listing 10.43 also adds a CSS id for each feed item using

<li  id= "<%=  feed item.id  %>" >

 

as required by the test in Listing 10.40.
   We can then add the feed to the Home page by rendering the feed partial as usual (Listing 10.44). The result is a display of the feed on the Home page, as required (Figure 10.14). 

 

 
 
 
image
Pooja   Negi

Skills    Ruby On Rails

Qualifications :- High School - SSN high school, College/University - HNBGU, College/University - SRHU,
Location :-Ranipokhari,Rishikesh,Uttarakhand,India
Description:- Student
Explore
 

  Students (0)