This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 93bad52fadc4fdd3d42f96e07e89500583d7b06a
tree 261ecca707b22a106c39db713efb986d31ee0fee
parent e80b7242a0e0527dcd680a096628a6efe7042ae7
tree 261ecca707b22a106c39db713efb986d31ee0fee
parent e80b7242a0e0527dcd680a096628a6efe7042ae7
| name | age | message | |
|---|---|---|---|
| |
.gitignore | ||
| |
MIT-LICENSE | Fri Apr 25 15:28:03 -0700 2008 | |
| |
README | ||
| |
Rakefile | Fri Apr 25 15:28:03 -0700 2008 | |
| |
init.rb | ||
| |
install.rb | Fri Apr 25 15:28:03 -0700 2008 | |
| |
lib/ | ||
| |
spec/ | ||
| |
tasks/ | ||
| |
uninstall.rb | Fri Apr 25 15:28:03 -0700 2008 |
README
OrderedAttributes
================
This Ruby on Rails plugin provides a way to order ActiveRecord attributes for using them for csv exports or automated
table generation.
Installation
============
git clone git://github.com/steffen/ordered-attributes.git vendor/plugins/ordered_attributes
or if you are on edge rails
script/plugin install git://github.com/steffen/ordered-attributes.git
Example
=======
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!
Copyright (c) 2008 Steffen Hiller, released under the MIT license








