Sha256: 38fb822186f3e8fdceabf19702ac4737a0fe87e7cf4983b3252207415c39fe43

Contents?: true

Size: 875 Bytes

Versions: 8

Compression:

Stored size: 875 Bytes

Contents

module Locomotive
  class MembershipsController < BaseController

    sections 'settings'

    def create
      @membership = current_site.memberships.build(params[:membership])
      @membership.role = 'author' # force author by default

      case @membership.process!
      when :create_account
        redirect_to new_account_url(email: @membership.email)
      when :save_it
        respond_with @membership, location: edit_current_site_url
      when :error
        respond_with @membership, flash: true
      when :already_created
        respond_with @membership, alert: t('flash.locomotive.memberships.create.already_created'), location: edit_current_site_url
      end
    end

    def destroy
      @membership = current_site.memberships.find(params[:id])
      @membership.destroy
      respond_with @membership, location: edit_current_site_url
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
locomotive_cms-2.2.2 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.2.1 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.2.0 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.1.4 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.1.3 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.1.2 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.1.1 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.1.0 app/controllers/locomotive/memberships_controller.rb