Class: PoBox::InboxesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/po_box/inboxes_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/po_box/inboxes_controller.rb', line 19

def create
  @inbox = Inbox.new(inbox_params)

  if @inbox.save
    redirect_to @inbox, notice: "Inbox was successfully created."
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject



37
38
39
40
# File 'app/controllers/po_box/inboxes_controller.rb', line 37

def destroy
  @inbox.destroy
  redirect_to inboxes_url, notice: "Inbox was successfully destroyed."
end

#editObject



16
17
# File 'app/controllers/po_box/inboxes_controller.rb', line 16

def edit
end

#indexObject



5
6
7
# File 'app/controllers/po_box/inboxes_controller.rb', line 5

def index
  @inboxes = Inbox.all
end

#newObject



12
13
14
# File 'app/controllers/po_box/inboxes_controller.rb', line 12

def new
  @inbox = Inbox.new
end

#showObject



9
10
# File 'app/controllers/po_box/inboxes_controller.rb', line 9

def show
end

#updateObject



29
30
31
32
33
34
35
# File 'app/controllers/po_box/inboxes_controller.rb', line 29

def update
  if @inbox.update(inbox_params)
    redirect_to @inbox, notice: "Inbox was successfully updated."
  else
    render :edit, status: :unprocessable_entity
  end
end