New to Rails. Using Authlogic for authentication and went through
tutorial at github. Having a bit of a problem getting the login
screen to render as a partial from a different view file.
I have a index.html.erb view file for the "home" controller.
I tried <%= render :partial => "user_sessions/user_session" %>
but it fails with this error:
"Called id for nil, which would mistakenly be 4 -- if you really
wanted the id of nil, use object_id"
user_sessions is the view directory for the login form created through
the Authlogic tutorial. I created a partial called
_user_session.html.erb which contains the entire login form and looks
<% form_for @user_session, :url => user_session_path do |f| %>
<%= f.error_messages %>
<%= f.label :email %><br />
<%= f.text_field :email %><br />
<%= f.label :password %><br />
<%= f.password_field :password %><br />
<%= f.check_box :remember_me %><%= f.label :remember_me %><br />
<%= image_submit_tag("/images/Login Button.jpg") %>
<% end %>
user_sessions/new.html.erb now looks like this
<%= render :partial => 'user_session' %>
However, trying this <%= render :partial => "user_sessions/
user_session" %> in the home/index.html.erb view fails.
Can anyone help with this? I seem to be missing something really