README.md in puffer-0.0.32 vs README.md in puffer-0.1.0

- old
+ new

@@ -1,20 +1,26 @@ -# Puffer - YARAI (Yet Another Rails Admin Interface). Rails 3.1 only. +# Puffer — YARAI (Yet Another Rails Admin Interface) -Puffer was created to help a project owner or moderators view and edit all the project's data models. It's compatible with Rails 3.1 only. +Puffer was created to help a project owner or moderators view and +edit all the project's data models. +**It's compatible with Rails 3.1 only.** + ## Discussion and help -puffer@conference.jabber.org +<xmpp:puffer@conference.jabber.org> ## Key features -* Full Rails integration. Puffer has no configuration, just a DSL to create interfaces. And this DSL depends on Rails conventions. -* Flexibility. Puffer designed to be as flexible as possible, so you can create your own modules easily. -* I18n. Surely. -* Puffer can support different ORMs or ODMs through orm_adapter. -* Implemented full AR and Mongoid support. +* Full Ruby on Rails integration. Puffer has no configuration files, but a +DSL to define administration interfaces. This DSL follows the Rails +conventions. +* Flexibility. Puffer designed to provide much flexibility as possible, +so you can create your own extensions without any design issues. +* Internationalization. Surely, enjoy the native Rails i18n subsystem. +* Puffer supports different ORMs or ODMs through the `orm_adapter` gem. +Currently, we can work with ActiveRecord and Mongoid. ## Installation. You can install puffer as a gem: @@ -24,13 +30,13 @@ `gem "puffer"` ## Introduction. -Let's assume this is the data structure of your project: +Let's assume this is the data structure of your application: -``` +```ruby create_table "users", :force => true do |t| t.string "email" t.string "password" t.datetime "created_at" t.datetime "updated_at" @@ -45,11 +51,11 @@ end ``` And let's also assume your models look like this: -``` +```ruby class User < ActiveRecord::Base has_many :posts validates_presence_of :email, :password validates_length_of :password, :minimum => 6 end @@ -58,21 +64,21 @@ belongs_to :user validates_presence_of :name, :surname end ``` -First, let's generate Puffer controllers: +First, let's generate the Puffer controllers: `rails g puffer:controller User` and `rails g puffer:controller Post` -This will generate this: +This will generate the following code: -``` +```ruby class Admin::PostsController < Puffer::Base setup do group :posts end @@ -95,36 +101,38 @@ end end ``` -Puffer's controller DSL creates all the actions you need. Next step: routing. +Puffer's DSL creates all the actions you need. Next step is routing. -``` +```ruby namespace :admin do resources :users do resources :posts end resources :posts end ``` -Let me explain this feature. Puffer tracks all the nested resources. So, with this routing structure we can access, for example, only specified user's posts: +Let me explain this feature. Puffer tracks all the nested resources. +For instance, according to our routing definitions, we can access only +specified posts of our user: `/admin/users/1/post` -Routing nesting defines admin interface resources nesting. +Routing nesting implies the admin resources nesting. ## Advanced usage -Puffer can be used in other namespaces than admin: +Puffer can work in different namespaces: `rails g puffer:controller moderator/posts` And we'll get posts controller for moderators: -``` +```ruby class Moderator::PostsController < Puffer::Base before_filter :require_moderator setup do destroy false @@ -145,14 +153,17 @@ field :updated_at end end ``` -As you can see, moderators can't destroy posts. The moderator's post controller is placed in the Posting tab of the admin interface. +As you can see, moderators can't destroy posts. The moderator's post +controller is placed in the Posting tab of the admin interface. Finally, don't forget about routing: -``` +```ruby namespace :moderator do resources :posts end -``` \ No newline at end of file +``` + +Have a nice day and let Puffer rock for you.