My upgrade to Rails 3 has been surprisingly smooth, however there have been a few minor issues with one of the Gems I use frequently, Authlogic. Both issues occur in the user_session model.
The first issue occurs when trying to load the user_sessions#new action.
NoMethodError in User_sessions#new undefined method `key' for #<UserSession: no credentials provided>
To fix this issue, we must add the following method to the user_session model.
def to_key new_record? ? nil : [ self.send(self.class.primary_key) ] end
The second issue occurs at the user_sessions#create action. The URL looks something like /user_sessions/%23…… and this obviously throws an error. The solution is to change the form tag in new.html.erb.
<% form_for (@user_session, :url => { :action => "create" }) do |f| %>
#or for formtastic
<% semantic_form_for @user_session, :url => { :action => "create" } do |f| %>
Hope this helps.
Thanks,
Cameron