Displaying 1 result from an estimated 1 matches for "basiccrudcontrol".
2006 Aug 04
4
DRY DRY DRY
...RUD actions in every controller and views for them is not DRY at all!
Few days ago I found http://dereksivers.com/rails-shared-controller.html
I quite like his generic controller, not Nub class though !
And I''ve adopted it for my project as:
controllers/basic_crud_controller.rb
...
class BasicCRUDController < ApplicationController
ITEMS_PER_PAGE = 15
before_filter :initialize_crud_controller
verify :method => :post, :only => [ :destroy, :create, :update ],
:redirect_to => { :action => :list }
def index
list
end
def list
@items = model_class.find :all, :li...