Sha256: 73104de5c7b101db405718436753e4688b1c15d9cdcf9320286d6af636aaf08b

Contents?: true

Size: 900 Bytes

Versions: 15

Compression:

Stored size: 900 Bytes

Contents

module Admin
  class MembershipsController < BaseController
    
    sections 'settings'
    
    def new
      @membership = current_site.memberships.build
    end

    def create
      @membership = current_site.memberships.build(params[:membership])

      case @membership.action_to_take
      when :create_account
        redirect_to new_admin_account_url(:email => @membership.email)
      when :save_it
        current_site.save
        flash_success!
        redirect_to edit_admin_site_url
      when :error
        flash_error! :now => true
        render :action => 'new'
      when :nothing
        flash[:error] = translate_flash_msg(:already_saved)
        redirect_to edit_admin_site_url
      end
    end

    def destroy
      current_site.memberships.find(params[:id]).destroy
      current_site.save

      flash_success!

      redirect_to edit_admin_site_url
    end
  
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
locomotive_cms-0.0.2.9 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2.8 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2.7 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2.6 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2.5 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2.4 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2.3 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2.2 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2.1 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.2 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.1.4 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.1.3 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.1.2 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.1.1 app/controllers/admin/memberships_controller.rb
locomotive_cms-0.0.1 app/controllers/admin/memberships_controller.rb