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

  • SEARCH
  • Home
  • 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 3602038
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:41:45+00:00 2026-05-18T20:41:45+00:00

I am using authlogic-connect in Rails. I am using a simple haml template where

  • 0

I am using authlogic-connect in Rails. I am using a simple haml template where i dont want to show the authorization providers who are already added.

%h2 My Account
%form.authentication_form{:action => connect_path, :method => :post}
  %fieldset
    %input{:type => :hidden, :name => :authentication_type, :value => :user}
    %legend Add another Oauth or OpenID provider.
    .oauth_providers
      %ul
        - %w(google facebook twitter yahoo).each do |name|
          %li.oauth_provider
            -unless "{user.authenticated_with}" =~ "{name}"
              %img{:src => "/images/icons/#{name}.png"}
              %input{:type => :radio, :id => "#{name}_oauth_provider", :name => :oauth_provider, :value => name}
        .clearfix
  %input.submit{:name => :submit, :type => :submit, :value => "Update"}/

I am encountering the error type mismatch: String. The user.authenticated with returns a string.

def authenticated_with
      @authenticated_with ||= self.access_tokens.collect{|t| t.service_name.to_s}
    end

What is the possible problem?

Stacktrace:

ActionView::Template::Error (type mismatch: String given):
    7:       %ul
    8:         - %w(google facebook twitter yahoo).each do |name|
    9:           %li.oauth_provider
    10:             -unless "{user.authenticated_with}" =~ "{name}"
    11:               %img{:src => "/images/icons/#{name}.png"}
    12:               %input{:type => :radio, :id => "#{name}_oauth_provider", :name => :oauth_provider, :value => name}
    13:         .clearfix
  app/views/users/edit.html.haml:10:in `=~'
  app/views/users/edit.html.haml:10:in `_app_views_users_edit_html_haml___2062853011_2171399360_0'
  app/views/users/edit.html.haml:8:in `each'
  app/views/users/edit.html.haml:8:in `_app_views_users_edit_html_haml___2062853011_2171399360_0'

Extracted source (around line #10): — Shows error on line 10

  • 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-18T20:41:46+00:00Added an answer on May 18, 2026 at 8:41 pm

    Pass a regular expression as argument to String#=~:

    >> string = "el"
    >> "hello" =~ /#{string}/
    => 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using authlogic-connect in Rails. I am using a simple haml template where
I'm trying to get the permit method to work using the rails-authorization-plugin and authlogic
I am using Authlogic-connect to connect various service providers. There is a method in
I'm using Authlogic 2.1.6 for Authorization in Rails 3.0.5 and I have a session
I'm using Authlogic with my Ruby on Rails App. I would like user to
I'm using Ruby on Rails 2.3.5 and Ruby 1.9 and implmeneted Authlogic as my
We're using authlogic, and we want to have a user accounted created and the
I am using authlogic with rails application for authentication. The perishable token is reset
I'm trying to set up a simple login using AuthLogic into my User table.
I am quite new to rails and I am using authlogic for my authentication

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.