Sha256: a892744d2292db4cc7b9041403d0c788455dbcf37b092e2a34feff5b9de21950
Contents?: true
Size: 1.17 KB
Versions: 4
Compression:
Stored size: 1.17 KB
Contents
[jTable](http://www.jtable.net/) - jQuery Datagrid done right ============================================================= [jTable JS project](https://github.com/yelvert/jtable) [jtable-rails RubyGem](https://github.com/yelvert/jtable-rails) [jTable.net source](https://github.com/yelvert/jtable-site) Usage ===== Basic ----- class Person < ActiveRecord::Base jtable :basic, :first_name, :last_name end This creates a jTable called *basic* with the attributes *first_name* and *last_name*. One-to-One Association ---------------------- class Person < ActiveRecord::Base has_one :place jtable :one_to_one, :first_name, :last_name, {:place => [:city, :state]} end This creates a jTable called *one_to_one* with the *person* attributes *first_name* and *last_name*, and the *place_attributes* *city* and *state*. Custom Attributes ----------------- class Person < ActiveRecord::Base jtable :custom, :first_name, :last_name, :date_of_birth def jtable_custom_attribute_date_of_birth self.date_of_birth.strftime("%m/%d/%Y") end end This will make the *date_of_birth* field be displayed with the format *mm/dd/yyyy*.
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
jtable-rails-0.2.5 | README.md |
jtable-rails-0.2.4 | README.md |
jtable-rails-0.2.3 | README.md |
jtable-rails-0.2.2 | README.md |