Render partial login form

I have two controllers (article, user) and associated views.
I want to render partial of the login form in the sidebar of the article
view by doing something like this.

<%= render(:partial => ‘login’) %>

and the _login.rthml has something as follow:

<%= start_form_tag %>
Name:
<%= text_field_tag :name, params[:name] %>
Password:
<%= password_field_tag :password, params[:password] %>
<%= submit_tag ‘Login’%>
<%= end_form_tag %>

however, I cannot figure out how to submit userid and password info
getting from the form to the “login” function in the user controller.
Could you please explain how to do this?
And if possible, I would like to make this login system looks like
digg’s one using AJAX.
Is there any tutorial for this?

<%= start_form_tag (:controller => ‘user’, :action => ‘login’ %>

should work.

See
http://rubyonrails.org/api/classes/ActionView/Helpers/FormTagHelper.html#M000491

Vish

hi, can someone explain partials?

a partial is a line of code in a view that can pass information to a
partial file (*the file that starts with an underscore with the same
name as the view) and can use whats in the partial file to replace the
line of code thats in the view?

Vishnu G. wrote:

<%= start_form_tag (:controller => ‘user’, :action => ‘login’ %>

should work.

See
http://rubyonrails.org/api/classes/ActionView/Helpers/FormTagHelper.html#M000491

Vish

Thanks! it works :smiley: