search for: dereksivers

Displaying 4 results from an estimated 4 matches for "dereksivers".

2006 Aug 03
5
DRYing up the view
Hello everyone! I have generic views for CRUD operations For example I render(''shared/list'') from controller shared/list.rhtml ... <% for item in @list %> <tr class="<%= cycle ''list-line-odd'', ''list-line-even'' %>"> <%= render :partial => ''item'', :locals => { :item => item } %>
2006 Aug 08
1
Cascading views?
For some fairly generic views and controller stuff I''d like to have a standard view, say app/views/shared/list.rhtml, and a way to override it per controller, app/views/mymodel/list.rhtml. I think I''ve read of a similar feature before, but I''m not really sure. I may be confusing things with engines and productize. Has someone implemented it for plain Rails apps?
2006 Aug 04
4
DRY DRY DRY
...the last month or so and really enjoyed this framework. However its very hard to find documentation on how to do things right! For example every beginner after a while realizes that having similar CRUD 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_controll...
2005 Aug 18
10
Scaffolding, DRY and RHTML
Hello all, I''m working on a couple of Rails projects at the moment and have noticed something that seems to go against the DRY principal. Why, when scaffolding, are individual CRUD rhtml files created instead of using one as a partial and having the others use that single partial? This especially applies to the list rhtml. I am about to get to the other operations and see how feasible