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 698035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:13:50+00:00 2026-05-14T03:13:50+00:00

background: trying to use the twitter gem for ruby-on-rails. in routes: map.resources :twitter_sessions map.finalize_twitter_sessions

  • 0

background: trying to use the twitter gem for ruby-on-rails.

in routes:

map.resources :twitter_sessions
map.finalize_twitter_sessions 'twitter_sessions/finalize', :controller => 'twitter_sessions', :action => 'finalize'

(twitter_sessions is the controller for the twitter sessions in my app).

The view has one file new.html.erb and is very simple:

<% form_tag(twitter_sessions_path)  do |f| %>
   <p><%= submit_tag "twitter!" %></p>
<% end %>

and the twitter_sessions_controller.rb:

def new
end

def create
  oauth.set_callback_url(finalize_twitter_sessions_url)

  session['rtoken']  = oauth.request_token.token
  session['rsecret'] = oauth.request_token.secret

  redirect_to oauth.request_token.authorize_url
end

def destroy
  reset_session
  redirect_to new_session_path
end

def finalize
  oauth.authorize_from_request(session['rtoken'], session['rsecret'], params[:oauth_verifier])

  profile = Twitter::Base.new(oauth).verify_credentials
  session['rtoken'] = session['rsecret'] = nil
  session[:atoken] = oauth.access_token.token
  session[:asecret] = oauth.access_token.secret

  sign_in(profile)
  redirect_back_or root_path
end

However, after I click the “twitter” button, I get this error:

401 Unauthorized

.../gems/oauth-0.3.6/lib/oauth/consumer.rb:200:in `token_request'
.../gems/oauth-0.3.6/lib/oauth/consumer.rb:128:in `get_request_token'
.../gems/twitter-0.9.2/lib/twitter/oauth.rb:32:in `request_token'
.../gems/twitter-0.9.2/lib/twitter/oauth.rb:25:in `set_callback_url'
app/controllers/twitter_sessions_controller.rb:7:in `create'

If I go to the finalize url, http://localhost:3000/twitter_sessions/finalize, directly, I get this error:

Unknown action

No action responded to show. Actions: create, destroy, finalize, isLoggedInToBeta, login_required, and new

Any ideas?
Thanks

  • 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-14T03:13:51+00:00Added an answer on May 14, 2026 at 3:13 am

    I’d try something a little different with your routes:

    map.resources :twitter_sessions, :collection { :finalize => :get } #use correct verb
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use a Google Map as a background, with a fixed overlay.
Im trying to use NSThread so my display pic can load in the background
I am trying to use a background worker in order to retrieve a large
Background: I'm getting a mapping failure when trying to use nHibernate. The application consists
I'm trying to use a custom textfield background. The problem is that the text
I trying to use the toggle function, to change the background and href of
I'm trying to use GreaseMonkey to replace the background image of a DIV on
I am trying to use a body background image which is center aligned, but
How to change a background color of jQueryUI Progressbar? Im trying to use: $('#progressbar
I'm trying to use a second background image with a floated div but it

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.