https://github.com/tb/inherited_resources_archetypes
InheritedResources archetypes modules
https://github.com/tb/inherited_resources_archetypes
Last synced: over 1 year ago
JSON representation
InheritedResources archetypes modules
- Host: GitHub
- URL: https://github.com/tb/inherited_resources_archetypes
- Owner: tb
- License: mit
- Created: 2011-06-26T19:30:19.000Z (about 15 years ago)
- Default Branch: master
- Last Pushed: 2011-07-16T14:27:00.000Z (almost 15 years ago)
- Last Synced: 2025-02-09T17:17:57.527Z (over 1 year ago)
- Language: Ruby
- Homepage:
- Size: 97.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: MIT-LICENSE
Awesome Lists containing this project
README
= Inherited Resources Archetypes
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', :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
include Archetype::Helpers::InheritedResources
include Archetype::Helpers::InheritedResources::OnUpdateSuccessRedirectToEdit
include Archetype::Helpers::InheritedResources::OnCreateSuccessRedirectToEdit
end
Now you can define your controller to use 'crud' archetype like this:
class UsersController < ApplicationController
archetype :crud
end
= TODO
* 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