Sha256: 6d6d7ff52745072a2cca038b2ec6e25c9293f7d0c17a38ddaac05c2383c3b4df

Contents?: true

Size: 612 Bytes

Versions: 4

Compression:

Stored size: 612 Bytes

Contents

class ResourcesController < InheritedResources::Base
  
  actions :index, :show, :new, :create, :edit, :update, :destroy
  respond_to :html, :xml, :json
  
  # 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

4 entries across 4 versions & 1 rubygems

Version Path
grimen-dry_scaffold-0.1.1 generators/dry_scaffold/templates/prototypes/controller_inherited_resources.rb
grimen-dry_scaffold-0.1.2 generators/dry_scaffold/templates/prototypes/controller_inherited_resources.rb
grimen-dry_scaffold-0.2.0 generators/dry_scaffold/templates/prototypes/controller_inherited_resources.rb
grimen-dry_scaffold-0.2.1 generators/dry_scaffold/templates/prototypes/controller_inherited_resources.rb