Sha256: 3fa457f584d7f7fb464c5d6075258375be26b9c8cc994d3c1190107e61e34a72

Contents?: true

Size: 645 Bytes

Versions: 13

Compression:

Stored size: 645 Bytes

Contents

class DucksController < InheritedResources::Base
  
  actions :index, :show, :new, :create, :edit, :update, :destroy
  respond_to :html, :xml, :json
  respond_to :atom, :rss, :only => [:index]
  
  # GET /ducks/custom_action
  def custom_action
    
  end
  
  protected
    
    def collection
      paginate_options ||= {}
      paginate_options[:page] ||= (params[:page] || 1)
      paginate_options[:per_page] ||= (params[:per_page] || 20)
      @collection = @ducks ||= end_of_association_chain.paginate(paginate_options)
    end
    
    def resource
      @resource = @duck ||= end_of_association_chain.find(params[:id])
    end
    
end

Version data entries

13 entries across 13 versions & 6 rubygems

Version Path
akitaonrails-dry_scaffold-0.3.3 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.3.0 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.3.1 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.3.2 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.3.3 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.3.4 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.3.5 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
pelle-dry_scaffold-0.3.5 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
dry_scaffold-0.3.8 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
dry_scaffold-0.3.7 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
dry_scaffold-0.3.6 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
blakechambers-dry_scaffold-0.3.6 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
michel-dry_scaffold-0.3.5 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb