Class: MystroVolley::ProjectsController

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

Instance Method Summary collapse

Methods included from ApplicationHelper

#path_helper

Instance Method Details

#destroyObject

DELETE /projects/1 DELETE /projects/1.json



77
78
79
80
81
82
83
84
85
# File 'app/controllers/mystro_volley/projects_controller.rb', line 77

def destroy
  @project = Project.find(params[:id])
  Jobs::Volley::Destroy::Project.create(data: {id: @project.id, class: "MystroVolley::Project"}).enqueue
  
  respond_to do |format|
    format.html { redirect_to projects_url }
    format.json { head :no_content }
  end
end

#indexObject

GET /projects GET /projects.json



7
8
9
10
11
12
13
14
# File 'app/controllers/mystro_volley/projects_controller.rb', line 7

def index
  @projects = Project.all
  
  respond_to do |format|
    format.html # index.html.erb
    format.json { render json: @projects }
  end
end

#showObject

GET /projects/1 GET /projects/1.json



18
19
20
21
22
23
24
25
# File 'app/controllers/mystro_volley/projects_controller.rb', line 18

def show
  @project = Project.find(params[:id])
  
  respond_to do |format|
    format.html # show.html.erb
    format.json { render json: @project.branches }
  end
end