Ruby On Rails Classroom image

Anil  Bist / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  |1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9|Last
Lessons:-Stats and a Follow Form

  Stats and a Follow Form

Now that our sample users have both followed user and followers arrays, we need to update the profile page and Home page to reflect this. We’ll start by making a partial to display the following and follower statistics on the profile and home pages. We’ll next add a follow/unfollow form, then make dedicated pages for showing user followed users and followers.

       As noted in Section 11.1.1, the word ‘‘following’’ is ambiguous as an attribute (where user.following could reasonably mean either the followed users or the user’s followers), it makes sense as a label, as in ‘‘50 following.’’ Indeed, this is the label used by Twitter itself, a usage adopted in the mockups starting in Figure 11.1 and shown in close-up in Figure 11.10.

Thestats in Figure 11.10 consist of the number of users the current user is following and the number of followers, each of which should be a link to its respective dedicated display page. In Chapter 5, we stubbed out such links with the dummy text ’#’, but that was before we had much experience  with   rutes. This time, although we’ll defer the actual pages to Section 11.2.3, we’ll make the routes now, as seen in Listing 11.18. This code uses the :member method inside a resources block, which we haven’t seen before, but see if you can guess what it does. (Note: The code in Listing 11.18 should replace the resources :users.)

 
 
 
image
Anil  Bist

Skills    Ruby On Rails

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India
Description:-

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a
Explore

 

  Students (0)