Sha256: a1f1dd0264968d9d550ccdef4cfac9a62582529dbdaf3a850f3d31621d6091fd
Contents?: true
Size: 797 Bytes
Versions: 62
Compression:
Stored size: 797 Bytes
Contents
module Workarea class Storefront::ContactsController < Storefront::ApplicationController def show model = Inquiry.new(inquiry_params) @inquiry = Storefront::InquiryViewModel.new(model) end def create inquiry = Inquiry.new(inquiry_params) if inquiry.save flash[:success] = t('workarea.storefront.flash_messages.contact_message_sent') Storefront::InquiryMailer.created(inquiry.id.to_s).deliver_later redirect_to contact_path else flash[:error] = t('workarea.storefront.flash_messages.contact_error') @inquiry = Storefront::InquiryViewModel.new(inquiry) render :show end end private def inquiry_params params.permit(:name, :email, :order_id, :subject, :message) end end end
Version data entries
62 entries across 62 versions & 1 rubygems