No description, website, or topics provided.
Ruby JavaScript
Permalink
Failed to load latest commit information.
app Fixed, now specs are running as they should on Rails3!@ Jan 21, 2011
config Fixed, now specs are running as they should on Rails3!@ Jan 21, 2011
db WIP Jan 21, 2011
doc First commit, empty project Oct 13, 2010
lib First version Dec 3, 2010
public WIP Jan 21, 2011
script WIP Jan 21, 2011
spec Fixed, now specs are running as they should on Rails3!@ Jan 21, 2011
vendor/plugins WIP Jan 21, 2011
.gitignore WIP Jan 21, 2011
.rspec WIP Jan 21, 2011
.rvmrc Fixed rvmrc for the 2.3.5 rails version Jan 21, 2011
Gemfile WIP Jan 21, 2011
Gemfile.lock WIP Jan 21, 2011
README Added project info to README file Dec 5, 2010
Rakefile WIP Jan 21, 2011
config.ru WIP Jan 21, 2011

README

# Sample project about table data structure in Rails

This sample project is meant to show how to introduce a simple data structure to represent a table in a Rails application.

Here's how it works:

* lib/table.rb is the Table class. It has two fields (headers and rows) and two convenience methods to add headers and rows.
* app/views/shared/_table.html.erb is the partial with the logic to represent the table. It receives as a local assign the table object to draw 

* app/controllers/people_controller.rb builds a table in the index action.

* app/views/people/index.html.erb shows an example usage of the _table.html.erb partial. 

In the future I'd like to add convenience methods to build a table like this directly from an ActiveRecord model; I want to reproduce the table built by the Rails scaffold generator, but doing it automatically, so you won't need to add manually any field to the view when you add them to the model.

Also I'd like to make it quite configurable, e.g. allow adding links to edit/delete actions, filter out some attributes, configure HTML classes for representing the table and so on.

Finally, I'd love to make this all a Rails plugin, so you can easily snap it into your project.