Sha256: b67db2109c8aca0c3fdd08755e045ab7bda5524752d991153ae20e9f05127c9c
Contents?: true
Size: 685 Bytes
Versions: 3
Compression:
Stored size: 685 Bytes
Contents
class EmailsController < ApplicationController def index @emails = Email.all end def new @email = Email.new end def edit @email = Email.find(params[:id]) end def create @email = Email.new(email_params) if @email.save redirect_to @email else render :new end end def update @email = Email.find(params[:id]) if @email.update_attributes(email_params) redirect_to @email else render :edit end end def show @email = Email.find(params[:id]) end protected def email_params params.require(:email).permit(:subject, :message, attachments_attributes: [:key, :id, :_destroy]) end end
Version data entries
3 entries across 3 versions & 1 rubygems