Class: Auctify::BidsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/auctify/bids_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

POST /bids



28
29
30
31
32
33
34
35
36
# File 'app/controllers/auctify/bids_controller.rb', line 28

def create
  @bid = Bid.new(bid_params)

  if @bid.save
    redirect_to @bid, notice: "Bid was successfully created."
  else
    render :new
  end
end

#destroyObject

DELETE /bids/1



48
49
50
51
# File 'app/controllers/auctify/bids_controller.rb', line 48

def destroy
  @bid.destroy
  redirect_to auctify_bids_url, notice: "Bid was successfully destroyed."
end

#editObject

GET /bids/1/edit



24
25
# File 'app/controllers/auctify/bids_controller.rb', line 24

def edit
end

#indexObject

GET /bids



10
11
12
# File 'app/controllers/auctify/bids_controller.rb', line 10

def index
  @bids = Bid.all
end

#newObject

GET /bids/new



19
20
21
# File 'app/controllers/auctify/bids_controller.rb', line 19

def new
  @bid = Bid.new
end

#showObject

GET /bids/1



15
16
# File 'app/controllers/auctify/bids_controller.rb', line 15

def show
end

#updateObject

PATCH/PUT /bids/1



39
40
41
42
43
44
45
# File 'app/controllers/auctify/bids_controller.rb', line 39

def update
  if @bid.update(bid_params)
    redirect_to @bid, notice: "Bid was successfully updated."
  else
    render :edit
  end
end