Forum: Ruby on Rails AJAX reload

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.
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-05-10 21:50
Ok I stole some script and I need some help on fixing it on one thing:
Reloading on post.
here's the script:
  <div id="panel">
    <form action="/loging_in/login" class="header-panel"
href="/loging_in/login" id="login-panel" method="post" onsubmit="new
Ajax.Request('/loging_in/login', {asynchronous:true, evalScripts:true,
onLoading:function(request){Form.disable(this)},
parameters:Form.serialize(this)}); return false;" style="display:none"
style="opacity:.80">
      <h2>Log in</h2>
      <div id="login-panel-message"></div>
    <p><label for="user_login">Login:</label><br/>
    <input type="text" name="user_login" id="user_login" size="30"
value=""/></p>

    <p><label for="user_password">Password:</label><br/>
    <input type="password" name="user_password" id="user_password"
size="30"/></p>

      <p>
        <input name="commit" type="submit" value="Log in" /> -or-
        <a href="#" onclick="Panels.Login.hide(); return
false;">cancel</a>
      </p>
    </form>
    <div id="header-panel" class="header-panel"
style="display:none">&nbsp;</div>

      <% if @session[:user] != nil %><a href="/loging_in/logout"
onclick="new Ajax.Request('/loging_in/logout', {asynchronous:true,
evalScripts:true}); return false;">Logout</a><% end %>
    </div>
    <% if @session[:user] == nil %><div id="default-status"
class="header-status">
      <a href="/loging_in/login" onclick="Panels.Login.toggle(); return
false;">Login</a>  |
      <a href="/loging_in/signup">Sign up</a> |
      <a href="loging_in/recover" onclick="Panels.Recover.toggle();
return false;">Forget your password?</a><% end %>

    </div>
  </div>
Now what I want is for it to reload if the user is loged in that way it
shows "logout" not "login | register | forgot password?" before they
reload the page. Some are thinking that they not logged in so there
complaing. How do I make it reload?
0a36dd2d45a8cead5dcfd27a9346f620?d=identicon&s=25 Mohammad (Guest)
on 2006-05-11 00:18
bump
24d2f8804e6bb4b7ea6bd11e0a586470?d=identicon&s=25 Jeremy Kemper (Guest)
on 2006-05-11 01:53
(Received via mailing list)
On May 10, 2006, at 3:18 PM, Mohammad wrote:
> bump

LORD ALMIGHTY.

jeremy
7f2b79cd5329a2c04562a873211e5d16?d=identicon&s=25 Mohammad (Guest)
on 2006-05-11 03:03
Jeremy Kemper wrote:
> On May 10, 2006, at 3:18 PM, Mohammad wrote:
>> bump
>
> LORD ALMIGHTY.
>
> jeremy

??
This topic is locked and can not be replied to.