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
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 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
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 |
#edit ⇒ Object
GET /lending_policies/1/edit
36 37 |
# File 'app/controllers/lending_policies_controller.rb', line 36 def edit end |
#index ⇒ Object
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 |
#new ⇒ Object
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 |
#show ⇒ Object
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 |
#update ⇒ Object
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 format.html { render action: "edit" } format.json { render json: @lending_policy.errors, status: :unprocessable_entity } end end end |