Browse files

README updates

  • Loading branch information...
1 parent 7cb07c5 commit 3d7b702bf07b3bf2f930f4c940fe4bc2f7549646 @croaky croaky committed Oct 30, 2008
Showing with 17 additions and 15 deletions.
  1. +17 −15 README.textile
View
32 README.textile
@@ -22,20 +22,6 @@ h2. Conventions
params[:sort] and params[:order]
-h2. Examples
-
-Use the sortable_attributes macro to list the... sortable attributes.
-
-Then, in your index action, pass the sort_order method to your usual
-order parameter for will paginate or named scope call.
-
- class UsersController < Admin::BaseController
- sortable_attributes :name, :email
- def index
- @users = User.paginate :page => params[:page], :order => sort_order
- end
- end
-
h2. Test with shoulda macros:
context "enough Users to sort" do
@@ -60,7 +46,23 @@ block to #should_sort_by_attributes:
end
end
-And some sugar for your views:
+h2. Controller
+
+Use the sortable_attributes macro to list the... sortable attributes.
+
+Then, in your index action, pass the sort_order method to your usual
+order parameter for will paginate or named scope call.
+
+ class UsersController < Admin::BaseController
+ sortable_attributes :name, :email
+ def index
+ @users = User.paginate :page => params[:page], :order => sort_order
+ end
+ end
+
+h2. View
+
+Add some sugar for your views:
%h1 Users
%table

0 comments on commit 3d7b702

Please sign in to comment.