Setting home

Hi
Sorry for this newb question but I’m stumped and need a point in the
right direction.

Basically I want visitors to go to /home and not /public. If they have
never been to the site I want to redirect them to /public for a welcome
page. I have part of this working. The problem I’m having is setting the
/home as the default for users that have the cookie.

In my home controller I have:
before_filter :check_redirect

def index
end

def check_redirect
if cookies[:viewed]
true
else
cookies[:viewed] = { :value => “1”, :expires => 1.year.from_now }
redirect_to “/index.html”
false
end
end

Thanks in advance,
Peter

Sorry one more bit of info. In my routes.rb I have

Install the default route as the lowest priority.

map.connect ‘:controller/:action/:id’
map.connect ‘’, :controller => “home”, :action => “index”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs