Sha256: 5ae75dac61c6f70153684418e0df045236eab6478ce23d7a96eba3b71144fd3f

Contents?: true

Size: 936 Bytes

Versions: 3

Compression:

Stored size: 936 Bytes

Contents

module Puffer
  class Base < ApplicationController
    unloadable

    respond_to :html

    include Puffer::Controller::Mutate
    include Puffer::Controller::Dsl
    include Puffer::Controller::Helpers

    def index
      @records = current_resource.collection
    end

    def show
      @record = current_resource.member
    end

    def new
      @record = current_resource.new_member
    end

    def edit
      @record = current_resource.member
    end

    def create
      @record = current_resource.new_member
      @record.save
      respond_with @record, :location => current_resource.path
    end

    def update
      @record = current_resource.member
      @record.update_attributes current_resource.attributes
      respond_with @record, :location => current_resource.path
    end

    def destroy
      @record = current_resource.member
      @record.destroy
      redirect_to current_resource.path
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
puffer-0.0.3 lib/puffer/base.rb
puffer-0.0.2 lib/puffer/base.rb
puffer-0.0.1 lib/puffer/base.rb