Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class ContactsController < ApplicationController
- before_filter :get_email
- before_filter :get_emails
- before_filter :get_client
- private #-------------------------------------------------------
- def get_email
- @email = Email.find(params[:email_id]) if params[:email_id]
- end
- def get_emails
- @emails = Email.where('account_id=?', current_account.id)
- end
- def get_client
- @client = GData::Client::Contacts.new
- if @email && !@email.auth_token.blank?
- @client.authsub_token = @email.auth_token
- else
- session[:client] = @client
- @client.authsub_token = params[:token]
- session[:token] = @client.auth_handler.upgrade
- @client.authsub_token = session[:token]
- end
- end
- end
Add Comment
Please, Sign In to add comment