Skip to content

Commit

Permalink
Added some docs to the table method
Browse files Browse the repository at this point in the history
  • Loading branch information
gregbell committed Apr 14, 2010
1 parent 0e4598f commit c26f182
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lib/inherited_views/table_builder.rb
Expand Up @@ -22,6 +22,29 @@ def default_table_columns
resource_class.content_columns.collect{|column| column.name.to_sym }
end


# Sets the columns to be displayed when the index table is rendered
# for this resource.
#
# Simple usage:
#
# Pass in a list of the methods to call on your resource in the order
# you wish to see them in the table
#
# class UsersController < InheritedViews::Base
# table :first_name, :last_name
# end
#
#
# Except:
#
# You can also use the default content columns from your ActiveRecord
# object and only exclude certain columns.
#
# class UsersController < InheritedViews::Base
# table :except => :first_name
# end
#
def table(*columns)
options = columns.extract_options!

Expand Down

0 comments on commit c26f182

Please sign in to comment.