Class: Workarea::Storefront::SharesController

Inherits:
Storefront::ApplicationController
  • Object
show all
Defined in:
app/controllers/workarea/storefront/shares_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
19
20
# File 'app/controllers/workarea/storefront/shares_controller.rb', line 9

def create
  if verify_recaptcha(model: @share, env: Rails.env) && @share.save
    flash[:success] = t(
      'workarea.storefront.flash_messages.share_message_sent',
      recipient: @share.friendly_to
    )
    ShareMailer.share(@share.id.to_s).deliver_later
    redirect_to @share.url
  else
    render :new
  end
end

#newObject



6
7
# File 'app/controllers/workarea/storefront/shares_controller.rb', line 6

def new
end