# class HooksController

### Public Instance Methods

create() click to toggle source

    # File app/controllers/hooks_controller.rb, line 13
    def create
      @hook = @project.hooks.new(params[:hook])
      @hook.save

      if @hook.valid?
        redirect_to project_hooks_path(@project)
      else
        @hooks = @project.hooks.all
        render :index
      end
    end

destroy() click to toggle source

    # File app/controllers/hooks_controller.rb, line 31
    def destroy
      @hook = @project.hooks.find(params[:id])
      @hook.destroy

      redirect_to project_hooks_path(@project)
    end

index() click to toggle source

    # File app/controllers/hooks_controller.rb, line 8
    def index
      @hooks = @project.hooks.all
      @hook = ProjectHook.new
    end

test() click to toggle source

    # File app/controllers/hooks_controller.rb, line 25
    def test
      TestHookContext.new(project, current_user, params).execute

      redirect_to :back
    end