How To: Remove a Partial

You just need to check to see if they’re logged in. Usually you’ll have something in the session like this:

<% unless session[:logged_in] %>
<%=render :partial =>“login” %>
<% end %>

Something along those lines.

your login form would be a form_remote tag.
Your controller that logs you in would render an rjs that does a page.remove “login_form_id” or whatever.

Keep in mind also that when you do that, you force users to have JS-enabled browsers. In my opinion, an app should still work if JS is disabled or not available.