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, #create, destroy, #destroy, #edit, #new, new_action, #update, update, #update_positions

Methods included from Core::ControllerHelpers::Common

included

Methods included from Core::ControllerHelpers::Auth

#current_ability, included, #redirect_back_or_default, #store_location, #try_spree_current_user, #unauthorized

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
24
25
# File 'app/controllers/spree/admin/prototypes_controller.rb', line 20

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

  respond_with(@prototypes)
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