Sha256: 2c6c8f40d1397552e16be2a9f565a89f0fb1452daec1f1c1237ac05dbaf772fb

Contents?: true

Size: 894 Bytes

Versions: 17

Compression:

Stored size: 894 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

17 entries across 17 versions & 2 rubygems

Version Path
locomotive_cms-2.0.3 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.2 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.1 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0 app/controllers/locomotive/memberships_controller.rb
tribeca_cms-0.1.1 app/controllers/locomotive/memberships_controller.rb
tribeca_cms-2.0.0.rc12 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc12 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc11 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc10 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc9 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc8 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc7 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc6 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc5 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc4 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc2 app/controllers/locomotive/memberships_controller.rb
locomotive_cms-2.0.0.rc1 app/controllers/locomotive/memberships_controller.rb