Skip to content

Commit

Permalink
Restore mistakenly removed capta use
Browse files Browse the repository at this point in the history
  • Loading branch information
laritakr committed Dec 18, 2023
1 parent da06c93 commit d7e8fe5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions app/controllers/hyrax/contact_form_controller.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# frozen_string_literal: true

# OVERRIDE: Hyrax v5.0.0
# - add inject_theme_views method for theming
# - add homepage presenter for access to feature flippers
# - add access to content blocks in the show method
# - add @featured_collection_list to new method
# - adds inject_theme_views method for theming
# - adds homepage presenter for access to feature flippers
# - adds access to content blocks in the show method
# - adds @featured_collection_list to new method
# - adds captcha

module Hyrax
class ContactFormController < ApplicationController
Expand Down Expand Up @@ -47,7 +48,12 @@ def new

def create
# not spam and a valid form
if @contact_form.valid?
# Override to include captcha
@captcha.values[:category] = params[:contact_form][:category]
@captcha.values[:contact_method] = params[:contact_form][:contact_method]
@captcha.values[:subject] = params[:contact_form][:subject]
@contact_form = model_class.new(@captcha.values)
if @contact_form.valid? && @captcha.valid?
ContactMailer.contact(@contact_form).deliver_now
flash.now[:notice] = 'Thank you for your message!'
after_deliver
Expand Down

0 comments on commit d7e8fe5

Please sign in to comment.