Class: CarrierTypeHasCheckoutTypesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/carrier_type_has_checkout_types_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /carrier_type_has_checkout_types POST /carrier_type_has_checkout_types.json



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File 'app/controllers/carrier_type_has_checkout_types_controller.rb', line 45

def create
  @carrier_type_has_checkout_type = CarrierTypeHasCheckoutType.new(params[:carrier_type_has_checkout_type])

  respond_to do |format|
    if @carrier_type_has_checkout_type.save
      flash[:notice] = t('controller.successfully_created', :model => t('activerecord.models.carrier_type_has_checkout_type'))
      format.html { redirect_to @carrier_type_has_checkout_type }
      format.json { render :json => @carrier_type_has_checkout_type, :status => :created, :location => @carrier_type_has_checkout_type }
    else
      prepare_options
      format.html { render :action => "new" }
      format.json { render :json => @carrier_type_has_checkout_type.errors, :status => :unprocessable_entity }
    end
  end
end

#destroyObject

DELETE /carrier_type_has_checkout_types/1 DELETE /carrier_type_has_checkout_types/1.json



79
80
81
82
83
84
85
86
# File 'app/controllers/carrier_type_has_checkout_types_controller.rb', line 79

def destroy
  @carrier_type_has_checkout_type.destroy

  respond_to do |format|
    format.html { redirect_to carrier_type_has_checkout_types_url }
    format.json { head :no_content }
  end
end

#editObject

GET /carrier_type_has_checkout_types/1/edit



40
41
# File 'app/controllers/carrier_type_has_checkout_types_controller.rb', line 40

def edit
end

#indexObject

GET /carrier_type_has_checkout_types GET /carrier_type_has_checkout_types.json



8
9
10
11
12
13
14
15
# File 'app/controllers/carrier_type_has_checkout_types_controller.rb', line 8

def index
  @carrier_type_has_checkout_types = CarrierTypeHasCheckoutType.all

  respond_to do |format|
    format.html # index.html.erb
    format.json { render :json => @carrier_type_has_checkout_types }
  end
end

#newObject

GET /carrier_type_has_checkout_types/new GET /carrier_type_has_checkout_types/new.json



28
29
30
31
32
33
34
35
36
37
# File 'app/controllers/carrier_type_has_checkout_types_controller.rb', line 28

def new
  @carrier_type_has_checkout_type = CarrierTypeHasCheckoutType.new
  @carrier_type_has_checkout_type.carrier_type = @carrier_type
  @carrier_type_has_checkout_type.checkout_type = @checkout_type

  respond_to do |format|
    format.html # new.html.erb
    format.json { render :json => @carrier_type_has_checkout_type }
  end
end

#showObject

GET /carrier_type_has_checkout_types/1 GET /carrier_type_has_checkout_types/1.json



19
20
21
22
23
24
# File 'app/controllers/carrier_type_has_checkout_types_controller.rb', line 19

def show
  respond_to do |format|
    format.html # show.html.erb
    format.json { render :json => @carrier_type_has_checkout_type }
  end
end

#updateObject

PUT /carrier_type_has_checkout_types/1 PUT /carrier_type_has_checkout_types/1.json



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'app/controllers/carrier_type_has_checkout_types_controller.rb', line 63

def update
  respond_to do |format|
    if @carrier_type_has_checkout_type.update_attributes(params[:carrier_type_has_checkout_type])
      flash[:notice] = t('controller.successfully_updated', :model => t('activerecord.models.carrier_type_has_checkout_type'))
      format.html { redirect_to @carrier_type_has_checkout_type }
      format.json { head :no_content }
    else
      prepare_options
      format.html { render :action => "edit" }
      format.json { render :json => @carrier_type_has_checkout_type.errors, :status => :unprocessable_entity }
    end
  end
end