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|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
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)