Class: MystroVolley::BranchesController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- MystroVolley::BranchesController
- Defined in:
- app/controllers/mystro_volley/branches_controller.rb
Instance Method Summary collapse
-
#destroy ⇒ Object
DELETE /branches/1 DELETE /branches/1.json.
-
#index ⇒ Object
GET /branches GET /branches.json.
-
#show ⇒ Object
GET /branches/1 GET /branches/1.json.
Methods included from ApplicationHelper
Instance Method Details
#destroy ⇒ Object
DELETE /branches/1 DELETE /branches/1.json
77 78 79 80 81 82 83 84 85 |
# File 'app/controllers/mystro_volley/branches_controller.rb', line 77 def destroy @branch = Branch.find(params[:id]) Jobs::Volley::Destroy::Branch.create(data: {id: @branch.id, class: "MystroVolley::Branch"}).enqueue respond_to do |format| format.html { redirect_to branches_url } format.json { head :no_content } end end |
#index ⇒ Object
GET /branches GET /branches.json
7 8 9 10 11 12 13 14 |
# File 'app/controllers/mystro_volley/branches_controller.rb', line 7 def index @branches = Branch.all respond_to do |format| format.html # index.html.erb format.json { render json: @branches } end end |
#show ⇒ Object
GET /branches/1 GET /branches/1.json
18 19 20 21 22 23 24 25 |
# File 'app/controllers/mystro_volley/branches_controller.rb', line 18 def show @branch = Branch.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @branch.versions } end end |