jrallison / authlogic_oauth

Authlogic OAuth is an extension of the Authlogic library to add OAuth support. OAuth can be used to allow users to login with their Twitter credentials.
authlogic-oauth.heroku.com
MIT License
165 stars 25 forks source link

oauth_login_button does not render in Rails 3 #17

Closed spinlock99 closed 13 years ago

spinlock99 commented 13 years ago

I've worked through the tutorial and I'm now trying to put a "login with twitter" button on my landing page. I've tried adding the following code to application.html.erb and to my sign_in form:

<%= oauth_login_button :value => "Login with Twitter" %>

but I don't get a button. Instead, I get the following text on the landing page:

<input type='submit' value='Login with Twitter' name='login_with_oauth' id='user_submit' class=''/>

When I view the html source, I see that rails is rendering the tag like this:

&lt;input type='submit' value='Login with Twitter' name='login_with_oauth' id='user_submit' class=''/&gt;

Any help on this would be greatly appreciated.

spinlock99 commented 13 years ago

I figured it out. Text is escaped by default in Rails 3 so you need to use the raw function to get the buttons to render on the application. For Rails 3, here's the tag you will need:

<%= raw oauth_login_button :value => "Login with Twitter" %>
jrallison commented 13 years ago

Hey spinlock,

That is the issue. However, this project hasn't been maintained in quite a while. I'd recommend switching to one of the more recently maintained forks which appear to have Rails 3 compatibility like https://github.com/logankoester/authlogic_oauth

Cheers, John

spinlock99 commented 13 years ago

Hi John,

Thanks for the link. I'll check it out. I've been trying not to pull gems from specific git repositories - it just seems brittle to me - but it looks like that is the best way work in rails3 because it's still bleeding edge at this point.

Thanks again, Andrew