Hi,
I am using Rick O.'s restful_authentication plugin, using
activefx’s great tutorial (http://www.railsforum.com/viewtopic.php?
id=14216) which works well but I am trying to understand how to use
partial to modify the workings a bit.
What I want to do is rather than have the user click on a link to get
to a logjn screen, have the username/password/submit form/controls to
be on the home page.
What I did was break the login form out into a partial "/app/views/
session/_login_form.html.erb) like so:
<% form_tag session_path do %>
I’m using an application template to allow me to have a common style,
etc for all my pages; the conditional code here shows the login form
items if you’re not logged in; if you are logged in it shows your user
name a a couple of links to edit your profit, change your password,
etc. It’s in controllers/views/layout/application.html.erb .
On this common template, I call the partial like this:
<%= render :partial => "/sessions/login_form", :locals
=>{:login => “login”, :password =>“password” } %>
Everything shows up ok, but when I click the login button, I get sent
to the old login template (i.e., the one you’d get to if you went to
http://localhost:3001/session/new ) which of course, since I am using
am app template, shows up on the body area of the template… and the
user isn’t logged in.
Is there something basic I am not getting about how to use a partial
to get a user logged in this way…?
Any advice would be appreciated!
_David