Sha256: d814da1f8c4a21c8769b2a303814169360d9690f811e0fea8a3fa8ab70af4385

Contents?: true

Size: 656 Bytes

Versions: 5

Compression:

Stored size: 656 Bytes

Contents

class ResourcesController < InheritedResources::Base
  
  actions :index, :show, :new, :create, :edit, :update, :destroy
  respond_to :html, :xml, :json
  respond_to :atom, :rss, :only => [:index]
  
  # GET /resources/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 = @resources ||= end_of_association_chain.paginate(paginate_options)
    end
    
    def resource
      @resource = @resource ||= end_of_association_chain.find(params[:id])
    end
    
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
grimen-dry_scaffold-0.2.2 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.2.3 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.2.4 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.2.5 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb
grimen-dry_scaffold-0.2.6 generators/dry_scaffold/prototypes/controllers/inherited_resources_controller.rb