# Class ProjectsController < ProjectResourceController

- app/controllers/projects_controller.rb

Methods

C
  - create
D
  - destroy
E
  - edit
F
  - files
G
  - graph
N
  - new
S
  - show
U
  - update
W
  - wall

Instance Public methods
create() Link

Source: show

    # File app/controllers/projects_controller.rb, line 20
    def create
      @project = Project.create_by_user(params[:project], current_user)

      respond_to do |format|
        flash[:notice] = 'Project was successfully created.' if @project.saved?
        format.html do
          if @project.saved?
            redirect_to @project
          else
            render action: "new"
          end
        end
        format.js
      end
    end

destroy() Link

Source: show

    # File app/controllers/projects_controller.rb, line 99
    def destroy
      return access_denied! unless can?(current_user, :remove_project, project)

      # Delete team first in order to prevent multiple gitolite calls
      project.truncate_team

      project.destroy

      respond_to do |format|
        format.html { redirect_to root_path }
      end
    end

edit() Link

Source: show

    # File app/controllers/projects_controller.rb, line 17
    def edit
    end

files() Link

Source: show

    # File app/controllers/projects_controller.rb, line 72
    def files
      @notes = @project.notes.where("attachment != 'NULL'").order("created_at DESC").limit(100)
    end

graph() Link

Source: show

    # File app/controllers/projects_controller.rb, line 89
    def graph
      respond_to do |format|
        format.html
        format.json do
          graph = Gitlab::Graph::JsonBuilder.new(project)
          render :json => graph.to_json
        end
      end
    end

new() Link

Source: show

    # File app/controllers/projects_controller.rb, line 13
    def new
      @project = Project.new
    end

show() Link

Source: show

    # File app/controllers/projects_controller.rb, line 55
    def show
      limit = (params[:limit] || 20).to_i
      @events = @project.events.recent.limit(limit).offset(params[:offset] || 0)

      respond_to do |format|
        format.html do
          unless @project.empty_repo?
            @last_push = current_user.recent_push(@project.id)
            render :show
          else
            render "projects/empty"
          end
        end
        format.js
      end
    end

update() Link

Source: show

    # File app/controllers/projects_controller.rb, line 36
    def update
      status = ProjectUpdateContext.new(project, current_user, params).execute

      respond_to do |format|
        if status
          flash[:notice] = 'Project was successfully updated.'
          format.html { redirect_to edit_project_path(project), notice: 'Project was successfully updated.' }
          format.js
        else
          format.html { render action: "edit" }
          format.js
        end
      end

    rescue Project::TransferError => ex
      @error = ex
      render :update_failed
    end

wall() Link

Wall

Source: show

    # File app/controllers/projects_controller.rb, line 80
    def wall
      return render_404 unless @project.wall_enabled
      @note = Note.new

      respond_to do |format|
        format.html
      end
    end