Class: Workarea::Storefront::ContactsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- ApplicationController
- Workarea::Storefront::ContactsController
- Defined in:
- app/controllers/workarea/storefront/contacts_controller.rb
Instance Method Summary collapse
Methods inherited from ApplicationController
#current_layout, #current_user_info, #health_check, #layout_content
Methods included from OrderLookup
Methods included from CurrentCheckout
#clear_current_order, #completed_order, #completed_order=, #current_checkout, #current_order, #current_order=, #current_shipping, #current_shippings, #logout
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/controllers/workarea/storefront/contacts_controller.rb', line 8 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 |
#show ⇒ Object
3 4 5 6 |
# File 'app/controllers/workarea/storefront/contacts_controller.rb', line 3 def show model = Inquiry.new(inquiry_params) @inquiry = Storefront::InquiryViewModel.new(model) end |