I've looked for several ways of doing this but none of the methods I
have found work correctly.
Basically, the website I am writing is navigated to using the standard
domain name, i.e. http://website.com/. Using the routes.rb file the root
of the website is mapped to a controller called 'home' so
http://website.com/ is the same as http://website.com/home\.
I have tried doing this by adding redirect_to to routes.rb, this didn't
work. I have also tried the redirect using .htaccess but unfortunately
my skills in this area are rather limited. I have also tried a plugin
that didn't work correctly.
I understand what you want to do but would that confuse the user? If I
went to att.com and then was redirected i would wonder why.
Is this a site someone would log into?
I understand what you want to do but would that confuse the user? If I
went to att.com and then was redirected i would wonder why.
Is this a site someone would log into?
Just curious.
John I
On Feb 17, 8:03�am, Digital Pardoe <rails-mailing-l...@andreas-s.net>
I'm really just after doing if for the sake of consistency, the blog is
accessed by /blog, photos by /photography, so why shouldn't home be
accessed with /home. It may also be something useful to add to my Rails
armory, and might come up again in the future for different purposes.
someone correct me if i'm really wrong, but i believe that what is
missing from the conversation is this:
when you do something like
map.root, :controller=>"home", :action=>"index" (if you want to
specify action) then you have a new named route, called root
so if you want to go back to the root of the application then what
would be www.mysite.com is actually www.mitesite.com/home...
throughout your app you can then use something like this:
link_to root_path
or link_to root_url
those are nice little guys that will do the named route business for
you. Then you can be nice and DRY and not actually specify your
domain at all, but let your application figure that part out for you.