Class: MissionControl::Servers::PublicProjectsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- MissionControl::Servers::PublicProjectsController
- Defined in:
- app/controllers/mission_control/servers/public_projects_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /public_projects.
-
#destroy ⇒ Object
DELETE /public_projects/1.
-
#index ⇒ Object
GET /public_projects.
-
#new ⇒ Object
GET /public_projects/new.
-
#show ⇒ Object
GET /public_projects/1.
Instance Method Details
#create ⇒ Object
POST /public_projects
29 30 31 32 33 34 35 36 37 |
# File 'app/controllers/mission_control/servers/public_projects_controller.rb', line 29 def create @public_project = @project.public_projects.new(public_project_params) if @public_project.save redirect_to project_public_projects_path(@project), notice: "Public project was successfully created." else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
DELETE /public_projects/1
40 41 42 43 44 |
# File 'app/controllers/mission_control/servers/public_projects_controller.rb', line 40 def destroy @public_project = @project.public_projects.find(params[:id]) @public_project.destroy! redirect_to project_public_projects_path(@project), notice: "Public project was successfully destroyed.", status: :see_other end |
#index ⇒ Object
GET /public_projects
6 7 8 |
# File 'app/controllers/mission_control/servers/public_projects_controller.rb', line 6 def index @public_projects = @project.public_projects.all end |
#new ⇒ Object
GET /public_projects/new
24 25 26 |
# File 'app/controllers/mission_control/servers/public_projects_controller.rb', line 24 def new @public_project = @project.public_projects.new end |
#show ⇒ Object
GET /public_projects/1
11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/controllers/mission_control/servers/public_projects_controller.rb', line 11 def show @project.public_projects.find_by!(token: params[:id]) hostnames = @project.services.pluck(:hostname).uniq @service_settings = @project.service_settings.where(hostname: hostnames) @services = if params[:hostname] @project.services.where(hostname: params[:hostname]).group_by(&:hostname) else @project.services.group_by(&:hostname) end end |