# Howto same order list fields in view and on paginate

**URL:** <https://www.ruby-forum.com/t/howto-same-order-list-fields-in-view-and-on-paginate/107872>\
**Category:** Rails\
**Created:** [June 27, 2007, 12:56am UTC](https://www.ruby-forum.com/t/howto-same-order-list-fields-in-view-and-on-paginate/107872 "2007-06-27T00:56:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fellons](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/ecc23a/32.png) [@fellons](https://www.ruby-forum.com/u/fellons)\
**Post date:** [June 27, 2007, 12:56am UTC](https://www.ruby-forum.com/t/howto-same-order-list-fields-in-view-and-on-paginate/107872/1 "2007-06-27T00:56:48Z")

</div>

Hi to all.

I have a this problem:  
on my controller.rb I have set attribute ‘select’ for paginate method;  
in my view I don’t understand how to estract field name and value  
with same order set.  
I’have try with attribute\_names or attributes, but  
with this method, list of fields are ordered in another way.  
sample:  
paginate :select ‘id,name,city’  
and, in view,  
for obj in .attribute\_names  
name, id, city

I must use different methods ?  
There is some setting to force ?

sorry for my english  
and thanks in advantage

bye by fellons
