Sha256: 3eca0282791868f92a22ca4920a230a3957a2d7ea067ac9940a7702a5f9ab15f
Contents?: true
Size: 1.32 KB
Versions: 42
Compression:
Stored size: 1.32 KB
Contents
module Virgo class SubscribersController < ApplicationController skip_before_action :verify_authenticity_token def create @subscriber = Subscriber.new(subscriber_params) if @subscriber.save render json: { status: :success, subscriber: @subscriber, html: render_content(partial: '/virgo/subscribers/success_modal') } else render json: { status: :err, subscriber: @subscriber, message: @subscriber.errors.full_messages, html: render_content(partial: '/virgo/common/list_signup') } end end def modal if request.post? @subscriber = Subscriber.new(subscriber_params) if @subscriber.save render json: { status: :success, html: render_content(partial: '/virgo/subscribers/success_modal') } else render json: { status: :err, html: render_content('/virgo/subscribers/modal', layout: false) } end else @subscriber = Subscriber.new render json: { html: render_content('/virgo/subscribers/modal', layout: false) } end end private def subscriber_params params.permit(subscriber: [:email])[:subscriber] end end end
Version data entries
42 entries across 42 versions & 1 rubygems