Ordered Attributes plugin

Plugin details

This Ruby on Rails plugin provides a way to order ActiveRecord attributes for using them for csv exports or automated table generation.

Websitehttp://www.extjswithrails.com/2008/04/ordered-attributes.html Repositorygit://github.com/steffen/ordered_attributes.git Author Steffen Hiller Tags order, attribute LicenseMIT

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 documentation

Edit plugin | (0 older versions) | Last edited by: hardway, 2 months ago