Ruby On Rails Classroom image

Anil  Bist / Professional / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2 | 3 | 4|Last
Lessons:- Followed users

To create a following relationship, we’ll introduce a follow! utility method so that we can write user.follow!(other_user). (This follow! method should always work, so, as with create! and save!, we indicate with an exclamation point that an exception will be raised on failure.) We’ll also add an associated following? boolean method to test if one user is following another.7 The tests in Listing 11.11 show how we expect these methods to be used in practice.

 

In the application code, the following? method takes in a user, called other_user, and checks to see if a followed user with that id exists in the database; the follow! method calls create! through the relationships association to create the following relationship. The results appear in Listing 11.12.

 
 
 
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)