This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
MIT-LICENSE | ||
| |
README.textile | ||
| |
Rakefile | ||
| |
init.rb | ||
| |
install.rb | ||
| |
lib/ | ||
| |
tasks/ | ||
| |
test/ | ||
| |
uninstall.rb |
README.textile
RestfulController
This is a very bare bones abstraction of the RESTful actions for a Rails resource controller. Nothing fancy. Supports pagination (for the index action, mainly) and custom Models (that don’t match the typical pattern – think of a SignupsController using a User model).
class ArticlesController < ApplicationController
restful_controller :model => Post, :pagination => true
end
Notes:
- by default the model will be the singularized version of the controller (ArticlesController => Article)
- automatically sets the expected instance variable for your views depending on the action being rendered. For articles example, the “show” action would setup an
@articlevariable, while the “index” action would setup an@articlesvariable, as you’d expect) - “supports pagination” means a #paginated(params[:page]) method will be called on your model (you may need to add that)
Nothing New
I’m aware that there are several solutions to this problem, but I didn’t want/need all of the features from that of resource_controller and friends. This plugin is very straight-forward and is primarily used for a few applications at work.
License
Copyright © 2009 Ryan Heath, released under the MIT license








