Note that there are some explanatory texts on larger screens.

plurals
  1. POuser_signed_in? always returns false
    primarykey
    data
    text
    <p>I have been following these railscasts</p> <p><a href="http://railscasts.com/episodes/209-introducing-devise" rel="nofollow">http://railscasts.com/episodes/209-introducing-devise</a> &amp;&amp; <a href="http://railscasts.com/episodes/233-engage-with-devise" rel="nofollow">http://railscasts.com/episodes/233-engage-with-devise</a> for user authentication, however whenever I try to see if a user is signed in, the response is always false.</p> <p>I tried a bunch of things to try remediating this issue. I tried different versions of devise and devise_rpx_connectable. I tried changing settings around in the configuration file. I tried running 'rails generate devise:install' a bunch of times with different gem versions.</p> <p>The weird thing is that when I change around the RPXNow.api_key to something bogus, I don't get an error, which is unexpected behavior.</p> <p>Here is the code in my application.html.erb file:</p> <pre><code>&lt;% if user_signed_in? %&gt; Signed in as &lt;%= current_user.email %&gt;. Not you? &lt;%= link_to "Sign out", destroy_user_session_path %&gt; &lt;% else %&gt; &lt;%= link_to_rpx "Sign in", user_session_url %&gt; &lt;% end %&gt; &lt;%= javascript_include_rpx(root_url) %&gt; </code></pre> <p>Here is the code in my user model user.rb file</p> <pre><code>class User &lt; ActiveRecord::Base devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :rpx_connectable attr_accessible :email, :password, :password_confirmation validates :email, :uniqueness =&gt; true .....other stuff.... end </code></pre> <p>Here is part of my Gemfile:</p> <pre><code>gem 'rails', '3.2.6' gem 'devise','2.0.0' gem 'devise_rpx_connectable' </code></pre> <p>and this gets the devise_rpx_connectable gem version 0.2.2</p> <p>Here is whats in my initializers/devise.rb file:</p> <pre><code>Devise.setup do |config| config.mailer_sender = "please-change-me-at-config-initializers-devise@example.com" config.apply_schema = false require 'devise/orm/active_record' config.case_insensitive_keys = [ :email ] config.strip_whitespace_keys = [ :email ] config.skip_session_storage = [:http_auth] config.stretches = Rails.env.test? ? 1 : 10 config.reconfirmable = true config.use_salt_as_remember_token = true config.reset_password_within = 6.hours config.sign_out_via = :delete config.rpx_application_name = "appname" RPXNow.api_key = "&lt;any_key_we_want_apparently&gt;" end </code></pre> <p>And this is in our routes.rb file:</p> <pre><code>AppName::Application.routes.draw do root :to =&gt; "pages#home" match 'users/:id' =&gt; "users#index" devise_for :users end </code></pre> <p>--editted after ply's comment--- I did rails g migration add_rpx_to_users rpx_identifier:string</p> <p>and ran rake db:migrate on this:</p> <pre><code>class AddRpxToUsers &lt; ActiveRecord::Migration def change add_column :users, :rpx_identifier, :string end end </code></pre> <p>If anyone has any thoughts, please share. I have been struggling with this issue all day.</p> <p>Thank you very much!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload