Forum: Ruby on Rails Forms + Partials integration in login

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
hpacheco (Guest)
on 2007-05-26 22:32
(Received via mailing list)
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
lanzm (Guest)
on 2007-05-28 14:53
(Received via mailing list)
could you be more precise ? I can speculate...

  you can call controller methods in a view:

<%  controller.the_method(some_variable,some_other)  %>

--
marcel
Hugo Pacheco (Guest)
on 2007-05-29 16:27
(Received via mailing list)
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
Helder O. (Guest)
on 2007-05-29 16:44
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
This topic is locked and can not be replied to.