Class: Spree::Admin::PrototypesController

Inherits:
ResourceController show all
Defined in:
app/controllers/spree/admin/prototypes_controller.rb

Instance Method Summary collapse

Methods inherited from ResourceController

belongs_to, #create, #destroy, #edit, #new, #update, #update_positions

Instance Method Details

#availableObject



12
13
14
15
16
17
18
# File 'app/controllers/spree/admin/prototypes_controller.rb', line 12

def available
  @prototypes = Prototype.order('name asc')
  respond_with(@prototypes) do |format|
    format.html { render :layout => !request.xhr? }
    format.js
  end
end

#selectObject



20
21
22
23
# File 'app/controllers/spree/admin/prototypes_controller.rb', line 20

def select
  @prototype ||= Prototype.find(params[:id])
  @prototype_properties = @prototype.properties
end

#showObject



4
5
6
7
8
9
10
# File 'app/controllers/spree/admin/prototypes_controller.rb', line 4

def show
  if request.xhr?
    render :layout => false
  else
    redirect_to admin_prototypes_path
  end
end