Class: UserGroupHasCheckoutTypesController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /user_group_has_checkout_types POST /user_group_has_checkout_types.json



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

def create
  @user_group_has_checkout_type = UserGroupHasCheckoutType.new(params[:user_group_has_checkout_type])

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

#destroyObject

DELETE /user_group_has_checkout_types/1 DELETE /user_group_has_checkout_types/1.json



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

def destroy
  @user_group_has_checkout_type.destroy

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

#editObject

GET /user_group_has_checkout_types/1/edit



41
42
# File 'app/controllers/user_group_has_checkout_types_controller.rb', line 41

def edit
end

#indexObject

GET /user_group_has_checkout_types GET /user_group_has_checkout_types.json



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

def index
  @user_group_has_checkout_types = UserGroupHasCheckoutType.includes([:user_group, :checkout_type]).order('user_groups.position, checkout_types.position').page(params[:page])

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

#newObject

GET /user_group_has_checkout_types/new GET /user_group_has_checkout_types/new.json



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

def new
  @user_group_has_checkout_type = UserGroupHasCheckoutType.new(
    :checkout_type => get_checkout_type,
    :user_group => get_user_group
  )

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

#showObject

GET /user_group_has_checkout_types/1 GET /user_group_has_checkout_types/1.json



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

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

#updateObject

PUT /user_group_has_checkout_types/1 PUT /user_group_has_checkout_types/1.json



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

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