app/controllers/clients_controller.rb
# 
# Removes client's login from system
# RJS action 
#

Removes client's login from system
RJS action
Removes client ' s login from system RJS action
def destroy_client_login    
    begin
      clients_login = ClientsLogin.find(params[:client_login_id])
      @client = Client.find(clients_login.client.id)
      if clients_login.destroy
        @result_text  = "Client's login #{clients_login.login} removed!"
      else
        @result_text  = "Error occured while deleting client's login"
      end
    rescue Exception => e
      @result_text  = "Error occured while deleting client's login: #{e}"
    end
    render :update do |page|
      page.replace_html "client_logins", :partial => "list_logins" unless @result_text =~ /^Error/
      page['client_login_result_text'].innerHTML = @result_text
      page.visual_effect :highlight, "client_login_result_text"
    end
  end
def destroy_client_login begin clients_login = ClientsLogin . find ( params [ :client_login_id ] ) @client = Client . find ( clients_login . client . id ) if clients_login . destroy @result_text = "Client's login #{clients_login.login} removed!" else @result_text = "Error occured while deleting client's login" end rescue Exception => e @result_text = "Error occured while deleting client's login: #{e}" end render :update do | page | page . replace_html "client_logins" , :partial => "list_logins" unless @result_text =~ / ^Error / page [ 'client_login_result_text' ] . innerHTML = @result_text page . visual_effect :highlight , "client_login_result_text" end end
Removes client's login from system
RJS action
Removes client ' s login from system RJS action