Sha256: 4557b7de2e64beeb932973fa62c697a00eed90aa73dd3d4c7f5b96f05532c540
Contents?: true
Size: 552 Bytes
Versions: 31
Compression:
Stored size: 552 Bytes
Contents
class Admin::GroupsController < Admin::ResourceController helper :reader paginate_models skip_before_filter :load_model before_filter :load_model, :except => :index # we want the filter to run before :show too def show end def load_models self.models = paginated? ? model_class.roots.paginate(pagination_parameters) : model_class.roots.all end def load_model self.model = if params[:id] model_class.find(params[:id]) else model_class.new(:parent_id => params[:parent_id]) end end end
Version data entries
31 entries across 31 versions & 1 rubygems