Sha256: 07511b307d9af184f62f1ce23d630db6070008f7dbd45c3fbfe3ec9460161f2e

Contents?: true

Size: 953 Bytes

Versions: 10

Compression:

Stored size: 953 Bytes

Contents

class E9Vendors::VendorProxiesController < Admin::ResourceController
  include E9Vendors::Controller

  belongs_to :vendor_member
  defaults :instance_name => :vendor

  add_resource_breadcrumbs

  def update
    update! do |format|
      format.html { redirect_to collection_path }
      format.js
    end
  end

  protected

  def determine_layout
    request.xhr? ? false : super
  end

  def add_index_breadcrumb
    add_breadcrumb parent.class.model_name.human.pluralize, polymorphic_path(parent.class)
    add_breadcrumb (@index_title = e9_t(:index_title, :member => parent.name)), collection_path
  end

  def decorate(records)
    VendorProxyDecorator.decorate(records)
  end

  def collection
    get_collection_ivar || set_collection_ivar(decorate end_of_association_chain.joins(:vendor).order('vendors.name').all)
  end

  def resource
    get_resource_ivar || set_resource_ivar(decorate end_of_association_chain.find(params[:id]))
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
e9_vendors-0.0.10 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.9 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.8 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.7 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.6 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.5 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.4 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.3 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.2 app/controllers/e9_vendors/vendor_proxies_controller.rb
e9_vendors-0.0.1 app/controllers/e9_vendors/vendor_proxies_controller.rb