Sha256: 3a70ef8b06aea8a2adb4c756f7ec8b0b41f9d239904afeb1c46adf3a770ff4b5
Contents?: true
Size: 666 Bytes
Versions: 11
Compression:
Stored size: 666 Bytes
Contents
module Alchemy class AjaxFormsController < Alchemy::BaseController def create @object = base_class.new permitted_resource_attributes if verify_recaptcha(model: @object) && @object.valid? #registro dati, invio email unless @object.send_only? @object.save end @object.mail_deliver render formats: :json else render formats: :json, status: :not_acceptable end end private def permitted_resource_attributes params.require(base_class.to_s.demodulize.underscore).permit! end def base_class controller_name.classify.constantize end end end
Version data entries
11 entries across 11 versions & 1 rubygems