Class: LendingPoliciesController

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

Instance Method Summary collapse

Instance Method Details

#createObject

POST /lending_policies POST /lending_policies.json



41
42
43
44
45
46
47
48
49
50
51
52
# File 'app/controllers/lending_policies_controller.rb', line 41

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

#destroyObject

DELETE /lending_policies/1 DELETE /lending_policies/1.json



71
72
73
74
75
76
77
78
# File 'app/controllers/lending_policies_controller.rb', line 71

def destroy
  @lending_policy.destroy

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

#editObject

GET /lending_policies/1/edit



36
37
# File 'app/controllers/lending_policies_controller.rb', line 36

def edit
end

#indexObject

GET /lending_policies GET /lending_policies.json



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

def index
  @lending_policies = LendingPolicy.page(params[:page])

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

#newObject

GET /lending_policies/new GET /lending_policies/new.json



28
29
30
31
32
33
# File 'app/controllers/lending_policies_controller.rb', line 28

def new
  respond_to do |format|
    format.html # new.html.erb
    format.json { render json: @lending_policy }
  end
end

#showObject

GET /lending_policies/1 GET /lending_policies/1.json



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

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

#updateObject

PUT /lending_policies/1 PUT /lending_policies/1.json



56
57
58
59
60
61
62
63
64
65
66
67
# File 'app/controllers/lending_policies_controller.rb', line 56

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