Ordered Attributes plugin
Plugin details
Documentation
Install the plugin:
ruby script/plugin install git://github.com/steffen/ordered_attributes.git
class Person < ActiveRecord::Base attr_order :name, :street, :zip, :city attr_groups :address => [:street, :zip, :city], :birth => [:date_of_birth, :place_of_birth], // you can use %w(date_of_birth place_of_birth) as well :all => [:name, :address, :birth] end
Use the ordered_attributes method to get the ordered attributes:
Person.ordered_attributes => [:name, :street, :zip, :city] Person.ordered_attributes(:all) => [:name, :street, :zip, :city, :date_of_birth, :place_of_birth]
See spec/ordered_attributes_spec.rb for more Examples!
Further Documentation
There is currently no advanced documentation for this plugin.
New documentationEdit plugin | (0 older versions) | Last edited by: hardway, 2 months ago

