simplification de EmailsController
This commit is contained in:
parent
629d3b3d94
commit
8ac87c1303
|
@ -1,5 +1,4 @@
|
|||
class EmailsController < ApplicationController
|
||||
before_action :set_email, only: [:show, :edit, :update, :destroy]
|
||||
|
||||
# GET /emails
|
||||
def index
|
||||
|
@ -8,31 +7,13 @@ class EmailsController < ApplicationController
|
|||
|
||||
# GET /emails/1
|
||||
def show
|
||||
end
|
||||
|
||||
# GET /emails/new
|
||||
def new
|
||||
@email = Email.new
|
||||
end
|
||||
|
||||
# GET /emails/1/edit
|
||||
def edit
|
||||
@email = Email.find(params[:id])
|
||||
end
|
||||
|
||||
# DELETE /emails/1
|
||||
def destroy
|
||||
@email = Email.find(params[:id])
|
||||
@email.destroy
|
||||
redirect_to emails_url, notice: 'Email was successfully destroyed.'
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
def set_email
|
||||
@email = Email.find(params[:id])
|
||||
end
|
||||
|
||||
# Only allow a list of trusted parameters through.
|
||||
def email_params
|
||||
params.fetch(:email, {})
|
||||
end
|
||||
end
|
||||
|
|
|
@ -3,8 +3,10 @@ require 'sidekiq/web'
|
|||
Rails.application.routes.draw do
|
||||
devise_for :users
|
||||
|
||||
resources :emails
|
||||
resources :emails, only: [:index, :show, :destroy]
|
||||
|
||||
resources :metadata_mappings
|
||||
|
||||
resources :filters do
|
||||
patch :enable, on: :member
|
||||
patch :disable, on: :member
|
||||
|
|
Loading…
Reference in a new issue