Class: MystroVolley::BranchesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mystro_volley/branches_controller.rb

Instance Method Summary collapse

Methods included from ApplicationHelper

#path_helper

Instance Method Details

#destroyObject

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

#indexObject

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

#showObject

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