# Forms + Partials integration in login

**URL:** <https://www.ruby-forum.com/t/forms-partials-integration-in-login/105181>\
**Category:** Rails\
**Created:** [May 26, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/forms-partials-integration-in-login/105181 "2007-05-26T20:32:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hpacheco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/dfb087/32.png) [@hpacheco](https://www.ruby-forum.com/u/hpacheco)\
**Post date:** [May 26, 2007, 8:32pm UTC](https://www.ruby-forum.com/t/forms-partials-integration-in-login/105181/1 "2007-05-26T20:32:32Z")

</div>

Hi all,

I’m new at rails, so maybe my problem is very stupid.

I’ve used act\_as\_authenticated to generate a login/logout/signup  
controllers and it all works fine.

However, I’ve put both views login and logout into a partial inside my  
main layout.

My problem is that these partials need to be loaded by the layout, and  
I don’t know how to call the previously default actions (‘login’ and  
‘logout’ of my controller) when i submit the forms (the login is  
represented as a form).

I really appreciate your help,  
hugo

---

<div class="post-metadata">

**Author:** ![hpacheco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/dfb087/32.png) [@hpacheco](https://www.ruby-forum.com/u/hpacheco)\
**Post date:** [May 28, 2007, 12:53pm UTC](https://www.ruby-forum.com/t/forms-partials-integration-in-login/105181/2 "2007-05-28T12:53:00Z")

</div>

could you be more precise ? I can speculate…

you can call controller methods in a view:

\<% controller.the\_method(some\_variable,some\_other) %\>

–  
marcel

---

<div class="post-metadata">

**Author:** ![hpacheco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/dfb087/32.png) [@hpacheco](https://www.ruby-forum.com/u/hpacheco)\
**Post date:** [May 29, 2007, 2:27pm UTC](https://www.ruby-forum.com/t/forms-partials-integration-in-login/105181/3 "2007-05-29T14:27:50Z")

</div>

I got it, my problem was the call of the login/logout action.

I know do

\<%= start\_form\_tag :controller =\> ‘conta’, :action =\> ‘login’ -%\>  
…

The next step is to try to do it using ajax, so i just refresh the  
partials, not the entire page.

hugo

---

<div class="post-metadata">

**Author:** ![hpacheco](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/dfb087/32.png) [@hpacheco](https://www.ruby-forum.com/u/hpacheco)\
**Post date:** [May 29, 2007, 2:44pm UTC](https://www.ruby-forum.com/t/forms-partials-integration-in-login/105181/4 "2007-05-29T14:44:29Z")

</div>

Hugo Pacheco wrote:

> I got it, my problem was the call of the login/logout action.
> 
> I know do
> 
> \<%= start\_form\_tag :controller =\> ‘conta’, :action =\> ‘login’ -%\>  
> …
> 
> The next step is to try to do it using ajax, so i just refresh the  
> partials, not the entire page.
> 
> hugo

Tens que fazer isso com o remote\_form\_tag, e depois usas rjs para fazer  
render das vÃ¡rias partials, ve se te safas com esta explicaÃ§Ã£o.

you must try remote\_form\_tag
