Sha256: d18502130bbc575596e37c18d11dfd1abc950593d3fea8d79940d1c759a8af0b

Contents?: true

Size: 825 Bytes

Versions: 6

Compression:

Stored size: 825 Bytes

Contents

module Amalgam
  class RegistrationsController < Amalgam::ApplicationController
    before_filter :get_resource_name, :only => [:update,:edit]
    before_filter :authenticate_scope!, :only => [:edit, :update]
    layout 'amalgam/admin/login'

    def edit
      render :edit
    end

    def update
      respond_to do |format|
        format.html do
          if @resource.update_attributes(params[resource_name])
            redirect_to after_update_path_for(@resource)
          else
            render :edit
          end
        end
      end
    end

    private

    def authenticate_scope!
      send(:"authenticate_#{params[:resource] || resource_name}!")
      @resource = send(:"current_#{params[:resource] || resource_name}")
    end

    def get_resource_name
      build_resource(params,false)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
amalgam-2.1.4.1 app/controllers/amalgam/registrations_controller.rb
amalgam-2.1.4 app/controllers/amalgam/registrations_controller.rb
amalgam-2.1.3.1 app/controllers/amalgam/registrations_controller.rb
amalgam-2.1.3 app/controllers/amalgam/registrations_controller.rb
amalgam-2.1.2 app/controllers/amalgam/registrations_controller.rb
amalgam-2.1.1 app/controllers/amalgam/registrations_controller.rb