Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update readme

  • Loading branch information...
commit 8e236d36176331a3a3b1af681629b2e4c979fe87 1 parent 3e3fb20
@tb authored
Showing with 15 additions and 16 deletions.
  1. +15 −16 README.rdoc
View
31 README.rdoc
@@ -1,39 +1,38 @@
-= Archetype
+= Inherited Resources Archetypes
-Archetype is a tool to support archetype-based apprach to share controllers and views behaviours.
-
-It can help you to manage controllers and views code with reuse in mind.
+This gem is a set of helpers to support archetype-based apprach
+to share controllers and views behaviours with Inherited Resources.
= Installation
Add do Gemfile
- gem 'archetype_helpers', :git => 'git://github.com/tb/archetype_helpers.git'
+ gem 'archetype', :git => 'git://github.com/tb/archetype.git'
+ gem 'inherited_resources_archetypes', :git => 'git://github.com/tb/inherited_resources_archetypes.git'
= Usage
Create an initializer with following code:
Archetype::Base.register_archetype :crud do
+ append_view_path Archetype::Resolver::Rails.new("archetype/crud")
+ append_view_path InheritedResourcesArchetypes::Resolver::Engine.new("archetype/crud")
inherit_resources
- append_view_path Helpers::Resolver.new("archetype/crud")
- include Helpers::InheritedResources::OnUpdateSuccessRedirectToEdit
- include Helpers::InheritedResources::OnCreateSuccessRedirectToEdit
- include Helpers::PerPage
+ include Archetype::Helpers::InheritedResources
+ include Archetype::Helpers::InheritedResources::OnUpdateSuccessRedirectToEdit
+ include Archetype::Helpers::InheritedResources::OnCreateSuccessRedirectToEdit
end
-Now you can define your controller, for example:
+Now you can define your controller to use 'crud' archetype like this:
class UsersController < ApplicationController
archetype :crud
end
-The action templates for the action will be taked from "views/archetype/crud".
-Archetype comes with a default set of vies for 'crud' archetype, so unless
-you want to overwrite those, all you have to do is define partials like those:
+= TODO
- _form.html.erb
- _list.html.erb
- _list_item.erb
+ * implement 5-7 archetypes & views
+ * document archetypes + ilustrate them with pictures
+ * publish some example Rails engines that use archetypes
Copyright (c) 2011 Tomasz Bąk, released under the MIT license
Please sign in to comment.
Something went wrong with that request. Please try again.