1

Hey guyz I want to pass a value from view with will_paginate and want to access this value in controller as params[:user][:id]. How will I do it?

4

1 回答 1

0

好的,所以你想做:

<%= will_paginate @user_rep, params: { start_date: @start_date, end_date: @end_date, user: @user.attributes.to_hash } %>

或者如果你想手工完成

<%= will_paginate @user_rep, params: { start_date: @start_date, end_date: @end_date, user: { id: @user_id } } %>
于 2012-12-17T09:36:50.273 回答