diff --git a/app/controllers/v1/contacts_controller.rb b/app/controllers/v1/contacts_controller.rb index 8680c4914ad6367512f8f0cda24949b75c595d17..48ddb15586f19d42609892f395ba3e259c0c8f91 100644 --- a/app/controllers/v1/contacts_controller.rb +++ b/app/controllers/v1/contacts_controller.rb @@ -22,13 +22,13 @@ class V1::ContactsController < ApplicationController before_action :authenticate_user!, except: [:create] before_action :set_contact, only: [:show, :update, :destroy] - before_action :set_new_contact, only: :index + before_action :set_new_contact, only: :index before_action :authorize!, except: [:create] # GET v1/contacts def index contacts = paginate policy_scope(Contact) - render json: contacts + render json: contacts end # GET v1/contacts/1 @@ -82,8 +82,8 @@ class V1::ContactsController < ApplicationController def authorize! authorize @contact end - - def set_new_contact - @contact ||= Contact.new - end + + def set_new_contact + @contact ||= Contact.new + end end diff --git a/app/mailers/contacts_mailer.rb b/app/mailers/contacts_mailer.rb index 35764830b3c05b3bc84b5f4cbd61fa2edcfb6141..385967ee17330fa74aa080b081494d0571a93f82 100644 --- a/app/mailers/contacts_mailer.rb +++ b/app/mailers/contacts_mailer.rb @@ -18,12 +18,12 @@ # along with portalmec. If not, see <http://www.gnu.org/licenses/>. class ContactsMailer < ApplicationMailer - default from: Proc.new { @contact.email } + default to: 'portalmec@inf.ufpr.br' def new_contact_received(contact) @contact = contact @subject = "Contato de " + @contact.name - mail(subject: @subject) + mail(from: @contact.email, subject: @subject) end def contact_updated(contact) diff --git a/env b/env new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391