I am newbie on RoR. I have an array of columns and users like this :
@user_form_column_list =
[#<MUserForm:0x0000560565e976c0
user_form_id: 1401,
site_id: 1071,
filed_name: "Kana",
db_column_name: "last_name",
input_type: nil,
input_rqrd: 1,
order_num: 1,
status_flg: 1>,
#<MUserForm:0x0000560565e976c0
user_form_id: 1402,
site_id: 1071,
filed_name: "Kanaaa",
db_column_name: "first_name",
input_type: nil,
input_rqrd: 1,
order_num: 1,
status_flg: 1>,...]
@users =
[#<TUser:0x00007f107d74a6f0
user_id: 11034,
site_id: 1071,
user_email: "[email protected]",
last_name: nil,
first_name: nil>,
#<TUser:0x00007f107d74a6f0
user_id: 11035,
site_id: 1071,
user_email: "[email protected]",
last_name: nil,
first_name: nil>,...]
In views: index.html.erb:
<table border="0" cellpadding="0" cellspacing="0" class="table_top" width="100%">
<tr>
<th width="60"> </th>
<% @user_form_column_list.each do |column| %>
<th><%= column.filed_name %></th>
<% end %>
</tr>
<%= render "t_user" %>
</table>
_t_user.html.erb:
<% @users.each.with_index do |user. index| %>
<tr>
<td>
<div align="center">
<%= link_to "link" do %>
<input type="button" value="編集">
<% end %>
</div>
</td>
<td nowrap="nowrap"><%= %></td>
</tr>
<% end %>
So, My question: How to display the correct value with the corresponding fields in file _t_user.html.erb?