Class: FrontEndBuilds::BuildsController
Instance Method Summary
collapse
#error!, #respond_with_json
Instance Method Details
#create ⇒ Object
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
# File 'app/controllers/front_end_builds/builds_controller.rb', line 14
def create
build = @app.builds.new(build_create_params)
if build.verify && build.save
build.setup!
head :ok
else
build.errors[:base] << 'No access - invalid SSH key' if !build.verify
render(
plain: 'Could not create the build: ' + build.errors.full_messages.to_s,
status: :unprocessable_entity
)
end
end
|
#index ⇒ Object
7
8
9
10
11
12
|
# File 'app/controllers/front_end_builds/builds_controller.rb', line 7
def index
builds = FrontEndBuilds::Build.where(app_id: params[:app_id])
respond_with_json({
builds: builds.map(&:serialize)
})
end
|
#show ⇒ Object
31
32
33
34
35
36
|
# File 'app/controllers/front_end_builds/builds_controller.rb', line 31
def show
build = FrontEndBuilds::Build.find(params[:id])
respond_with_json({
build: build.serialize
})
end
|