Sha256: 9adb5349115c62643e68d478ac6c014859363e48178d58ba39f71f0d23872015
Contents?: true
Size: 540 Bytes
Versions: 3
Compression:
Stored size: 540 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.paginate(pagination_parameters) : model_class.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
3 entries across 3 versions & 1 rubygems