Sha256: 68cfbf82e36c1aa0e0bd9f4ef44efc1a980177181195ee804b0b249f54f39512
Contents?: true
Size: 1.07 KB
Versions: 3
Compression:
Stored size: 1.07 KB
Contents
module Puffer class Base < ApplicationController unloadable pufferize! define_fieldset :index, :form define_fieldset :show, :fallbacks => :index define_fieldset :create, :update, :fallbacks => :form respond_to :html, :js def index @records = resource.collection end def show @record = resource.member end def new @record = resource.new_member end def edit @record = resource.member end def create @record = resource.new_member @record.save respond_with @record, :location => puffer_saving_location end def update @record = resource.member @record.update_attributes resource.attributes respond_with @record, :location => puffer_saving_location end def destroy @record = resource.member @record.destroy redirect_to (request.referrer || resource.collection_path) end private def puffer_saving_location params[:commit] == t('puffer.save') ? resource.edit_path(record) : resource.collection_path end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
puffer-0.0.23 | app/controllers/puffer/base.rb |
puffer-0.0.22 | app/controllers/puffer/base.rb |
puffer-0.0.21 | app/controllers/puffer/base.rb |