Class: LendingPoliciesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- LendingPoliciesController
- Defined in:
- app/controllers/lending_policies_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /lending_policies POST /lending_policies.json.
-
#destroy ⇒ Object
DELETE /lending_policies/1 DELETE /lending_policies/1.json.
-
#edit ⇒ Object
GET /lending_policies/1/edit.
-
#index ⇒ Object
GET /lending_policies GET /lending_policies.json.
-
#new ⇒ Object
GET /lending_policies/new GET /lending_policies/new.json.
-
#show ⇒ Object
GET /lending_policies/1 GET /lending_policies/1.json.
-
#update ⇒ Object
PUT /lending_policies/1 PUT /lending_policies/1.json.
Instance Method Details
#create ⇒ Object
POST /lending_policies POST /lending_policies.json
46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'app/controllers/lending_policies_controller.rb', line 46 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 format.html { render action: "new" } format.json { render json: @lending_policy.errors, status: :unprocessable_entity } end end end |
#destroy ⇒ Object
DELETE /lending_policies/1 DELETE /lending_policies/1.json
76 77 78 79 80 81 82 83 |
# File 'app/controllers/lending_policies_controller.rb', line 76 def destroy @lending_policy.destroy respond_to do |format| format.html { redirect_to lending_policies_url } format.json { head :no_content } end end |
#edit ⇒ Object
GET /lending_policies/1/edit
41 42 |
# File 'app/controllers/lending_policies_controller.rb', line 41 def edit end |
#index ⇒ Object
GET /lending_policies GET /lending_policies.json
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/lending_policies_controller.rb', line 9 def index if @item @lending_policies = @item.lending_policies.page(params[:page]) else @lending_policies = LendingPolicy.page(params[:page]) end respond_to do |format| format.html # index.html.erb format.json { render json: @lending_policies } end end |
#new ⇒ Object
GET /lending_policies/new GET /lending_policies/new.json
33 34 35 36 37 38 |
# File 'app/controllers/lending_policies_controller.rb', line 33 def new respond_to do |format| format.html # new.html.erb format.json { render json: @lending_policy } end end |
#show ⇒ Object
GET /lending_policies/1 GET /lending_policies/1.json
24 25 26 27 28 29 |
# File 'app/controllers/lending_policies_controller.rb', line 24 def show respond_to do |format| format.html # show.html.erb format.json { render json: @lending_policy } end end |
#update ⇒ Object
PUT /lending_policies/1 PUT /lending_policies/1.json
61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'app/controllers/lending_policies_controller.rb', line 61 def update respond_to do |format| if @lending_policy.update(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 format.html { render action: "edit" } format.json { render json: @lending_policy.errors, status: :unprocessable_entity } end end end |