Log_out problem

In my layout have :
<%= link_to ‘Log Out Now’, { :action => :log_out }%>

In my application.rb i have:
def log_out
session[:login]=nil
redirect_to ‘/inventory’
end

for some reason it keeps redirecting to “http://localhost:3000/
inventory/log_out” instead of /inventory…any suggestions?

Jon wrote:

In my layout have :
<%= link_to ‘Log Out Now’, { :action => :log_out }%>

In my application.rb i have:
def log_out
session[:login]=nil
redirect_to ‘/inventory’
end

for some reason it keeps redirecting to “http://localhost:3000/
inventory/log_out” instead of /inventory…any suggestions?

Well what is your controller name ?

any how,
you should use redirect_to :action=> ‘inventory’

i think it may work for you.

check out your routes setting.

Y Reinhart AP

if its a named route then simple u can call after redirect_to method or
else
after redirect_to method call :action

On Mon, Sep 29, 2008 at 6:40 PM, Rails T. <