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:- A First Feed Implementation

Situations like the one illustrated above, where the same method (e.g., to_s) gets called on each element, are common enough that there’s a shorthand notation using an ampersand & and a symbol corresponding to the method:12

 

Using the join method (Section 4.3.1), we can create a string composed of the ids by joining them on comma-space :

 

We can use the above method to construct the necessary array of followed user ids by calling id on each element in user.followed_users. For example, for the first user in the database this array appears as follows:

 

In fact, because this sort of construction is so useful, Active Record provides it by default:

 
 
 
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)