How does one enter multiple lines of code into the rails console?
–edit with problem trying to solve–
I am trying to get a handle on using the collect method and want to try out the following code in the rails console:
first_activities_collection = users.collect |user|
activities = user.activities
first = activities.first
And having difficulty getting it to execute.
I have tried:
first_activities_collection = users.collect |user|
activities = user.activities;
first = activities.first;
end
Maybe I am doing something wrong with .collect?
You are missing the
dokeyword in your loop.