Sha256: 90206a81717bde667644dcd541e6cfae3c8b5c3cd9732814bddd5da0ae4f95a1

Contents?: true

Size: 830 Bytes

Versions: 4

Compression:

Stored size: 830 Bytes

Contents

class Admin::PropertiesController < Admin::BaseController
  resource_controller
  
  before_filter :load_object, :only => :filtered
  belongs_to :product
  
  def filtered
    @properties = Property.find(:all, :conditions => ['lower(name) LIKE ?', "%#{params[:q].downcase}%"], :order => :name)
    render :template => "admin/properties/filtered.html.erb", :layout => false
  end
  
  new_action.response do |wants|
    wants.html {render :action => :new, :layout => !request.xhr? }
  end

  # redirect to index (instead of r_c default of show view)
  update.response do |wants| 
    wants.html {redirect_to collection_url}
  end
  
  # redirect to index (instead of r_c default of show view)
  create.response do |wants| 
    wants.html {redirect_to collection_url}
  end

  destroy.success.wants.js { render_js_for_destroy }
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
spree_core-0.30.2 app/controllers/admin/properties_controller.rb
spree_core-0.30.1 app/controllers/admin/properties_controller.rb
spree_core-0.30.0 app/controllers/admin/properties_controller.rb
spree_core-0.30.0.beta1 app/controllers/admin/properties_controller.rb