Ruby On Rails Classroom image

Neeraj  Amoli / Professional / 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
Neeraj  Amoli

Skills    Ruby On Rails

Qualifications :-
Location :-Dehradun,Dehradun,Uttrakhand,India
Description:-

I have 3 year experience as a Software Engineer. My Skilled are Android Development (Java), ROR Development .   


Explore
 

  Students (0)