simplification de EmailsController
This commit is contained in:
parent
629d3b3d94
commit
8ac87c1303
|
@ -1,5 +1,4 @@
|
||||||
class EmailsController < ApplicationController
|
class EmailsController < ApplicationController
|
||||||
before_action :set_email, only: [:show, :edit, :update, :destroy]
|
|
||||||
|
|
||||||
# GET /emails
|
# GET /emails
|
||||||
def index
|
def index
|
||||||
|
@ -8,31 +7,13 @@ class EmailsController < ApplicationController
|
||||||
|
|
||||||
# GET /emails/1
|
# GET /emails/1
|
||||||
def show
|
def show
|
||||||
end
|
@email = Email.find(params[:id])
|
||||||
|
|
||||||
# GET /emails/new
|
|
||||||
def new
|
|
||||||
@email = Email.new
|
|
||||||
end
|
|
||||||
|
|
||||||
# GET /emails/1/edit
|
|
||||||
def edit
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# DELETE /emails/1
|
# DELETE /emails/1
|
||||||
def destroy
|
def destroy
|
||||||
|
@email = Email.find(params[:id])
|
||||||
@email.destroy
|
@email.destroy
|
||||||
redirect_to emails_url, notice: 'Email was successfully destroyed.'
|
redirect_to emails_url, notice: 'Email was successfully destroyed.'
|
||||||
end
|
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
|
end
|
||||||
|
|
|
@ -3,8 +3,10 @@ require 'sidekiq/web'
|
||||||
Rails.application.routes.draw do
|
Rails.application.routes.draw do
|
||||||
devise_for :users
|
devise_for :users
|
||||||
|
|
||||||
resources :emails
|
resources :emails, only: [:index, :show, :destroy]
|
||||||
|
|
||||||
resources :metadata_mappings
|
resources :metadata_mappings
|
||||||
|
|
||||||
resources :filters do
|
resources :filters do
|
||||||
patch :enable, on: :member
|
patch :enable, on: :member
|
||||||
patch :disable, on: :member
|
patch :disable, on: :member
|
||||||
|
|
Loading…
Reference in a new issue