Class: PoBox::EmailsController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- PoBox::EmailsController
- Defined in:
- app/controllers/po_box/emails_controller.rb
Instance Method Summary collapse
-
#create ⇒ Object
POST /emails.
-
#destroy ⇒ Object
DELETE /emails/1.
-
#edit ⇒ Object
GET /emails/1/edit.
-
#index ⇒ Object
GET /emails.
-
#new ⇒ Object
GET /emails/new.
-
#show ⇒ Object
GET /emails/1.
-
#update ⇒ Object
PATCH/PUT /emails/1.
Instance Method Details
#create ⇒ Object
POST /emails
25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/po_box/emails_controller.rb', line 25 def create @email = Email.new(email_params) if @email.save redirect_to inbox_email_path(@inbox, @email), notice: "Email was successfully created." else render :new, status: :unprocessable_entity end end |
#destroy ⇒ Object
DELETE /emails/1
45 46 47 48 |
# File 'app/controllers/po_box/emails_controller.rb', line 45 def destroy @email.destroy redirect_to inbox_emails_url(@inbox), notice: "Email was successfully destroyed." end |
#edit ⇒ Object
GET /emails/1/edit
21 22 |
# File 'app/controllers/po_box/emails_controller.rb', line 21 def edit end |
#index ⇒ Object
GET /emails
7 8 9 |
# File 'app/controllers/po_box/emails_controller.rb', line 7 def index @emails = Email.all end |
#new ⇒ Object
GET /emails/new
16 17 18 |
# File 'app/controllers/po_box/emails_controller.rb', line 16 def new @email = Email.new end |
#show ⇒ Object
GET /emails/1
12 13 |
# File 'app/controllers/po_box/emails_controller.rb', line 12 def show end |
#update ⇒ Object
PATCH/PUT /emails/1
36 37 38 39 40 41 42 |
# File 'app/controllers/po_box/emails_controller.rb', line 36 def update if @email.update(email_params) redirect_to inbox_email_path(@inbox, @email), notice: "Email was successfully updated." else render :edit, status: :unprocessable_entity end end |