How to pass an array of model objects on a view


I am just beginning to understand how ruby on rails works. I have the
following problem:

In the controller I would like to create an array of model objects:

@arr_journeys =,

In the view I would like to do the following:

<% for i in 1…4 %>
<%= text_field(@arr_journeys[i], :quantity, :size => 6 %)>
<% end>

Is there any chance to do it like this? Do I have to write my own

Greets & thanks


you almost got it

@arr_journeys = …

<% @arr_journeys.each do |journey| -%>

<% end -%>