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.
4184124738873c21d5435fd4ef60d7df?d=identicon&s=25 hpacheco (Guest)
on 2007-05-26 20: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
15eb647956921a6bc9655c3513feb139?d=identicon&s=25 lanzm (Guest)
on 2007-05-28 12: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
4184124738873c21d5435fd4ef60d7df?d=identicon&s=25 Hugo Pacheco (Guest)
on 2007-05-29 14: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
B91fb9820dbbc5153dc27ce22508d947?d=identicon&s=25 Helder Oliveira (kay)
on 2007-05-29 14: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.