Permalink
Browse files

added usage to readme

  • Loading branch information...
1 parent 27ebf26 commit 8a0b339181e6a4161b61e04a4d3aee321c5ba50d @njackson committed Sep 15, 2011
Showing with 25 additions and 1 deletion.
  1. +25 −1 README.rdoc
View
@@ -1,6 +1,30 @@
= dci-rails
-Description goes here.
+== Usage:
+app/controllers/application_controller.rb
+ class ApplicationController < ActionController::Base
+ include DCI::Controller::DSL
+ ...
+ end
+
+app/controllers/comments_controller.rb
+ class CommentsController < ApplicationController
+ inherited_resources
+ extend_resource :build_resource, CustomCallbackRole
+ end
+
+app/roles/custom_callback_role.rb
+ module CustomCallbackRole
+ include DCI::Role
+
+ extended_metaclass_eval do
+ after_create :custom_callback
+ end
+
+ def custom_callback
+ ...
+ end
+ end
== Contributing to dci-rails

0 comments on commit 8a0b339

Please sign in to comment.