Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6040159
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:28:25+00:00 2026-05-23T06:28:25+00:00

i want to uses youtube’s api within rails. I need a client which is

  • 0

i want to uses youtube’s api within rails.

I need a client which is able to access youtubes api application wide.
therefore i wrote the following application controller

require 'gdata'
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :auth

def auth
@client = GData::Client::YouTube.new
@client.clientlogin('usermail', 'password')

@client
end

end

i am able to use the client now in my controllers which extend ApplicationController.
thats working fine.
but its pretty slow.

is there a way to do the authentication once and using it application wide instead of suing the before_filter which is getting called every single time before i call a method?

best,

philip

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T06:28:26+00:00Added an answer on May 23, 2026 at 6:28 am

    This is a web page. Webpages are state-less. Thus you cannot preserve any state. Thus you cannot preserve your login across requests. Thus you have to auth every request.

    An alternative would be to only run the before filter on certain controller actions. Right now it runs on every action, which my be not necessary.

    Try:

    before_filter :auth, :only=> my_action_name
    

    (P.S. That might be the wrong syntax — I’m confused ’cause rails changes so much — just look it up)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to distribute a webstart application which uses RMI. I want to avoid
I want to wrap a piece of code that uses the Windows Impersonation API
I want to index a computed column in my database table which uses a
I want to talk to a flash server which uses RTMP, but I don't
I have built an application that uses SQL Express 2005 and I want to
I have a website which uses PHP and HTML pages, I want to create
I'm writing a simple OpenGL application that uses GLUT . I don't want to
At the moment, our application uses the Trident Win32 component, but we want to
I just want to have default characteristic of ActiveRecord which uses incremental integers as
I want to write an application which can update an twitter status of an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.