Use reflection to show the list

I have two list
1) Groups that user part of
2) Group members list.

I trying to do this by using the reflection so that I will be having
only one view in which depending on the action the object passed will be

Is there any way to find the all attributes of the object so that I will
iterate on attributes array and list out the attribute values during

Any help appreciated.


Duno if it helps but

<%= render :partial= "partials/values", :collection => @values%>

@values = Object.all

<% value.attributes.each do |a| %>
  <%= a.to_a[0] %>:
  <%= a.to_a[1]>
<% end %>

["crypted_password", nil]
["username", nil]
["password_salt", nil]
["persistence_token", nil]
["email", nil]

Tushar Gandhi wrote: