Roseanne Zhang
2006-Oct-03 21:57 UTC
How to make index.html share with standard-layout.rhtml?
I can make all my pages in app/view share the same look and feel by using standard-layout.rhtml. However, when I go the root url: http://localhost:3000/ I get the /public/index.html. It does not share the same layout. I currently hard coded in index.html to make it look and feel the same. I believe that I must miss something simple and obvious, please help! Thanks in Advance! Roseanne -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Philip Hallstrom
2006-Oct-03 22:25 UTC
Re: How to make index.html share with standard-layout.rhtml?
> I can make all my pages in app/view share the same look and feel by > using standard-layout.rhtml. > > However, when I go the root url: http://localhost:3000/ I get the > /public/index.html. It does not share the same layout. I currently hard > coded in index.html to make it look and feel the same. > > > I believe that I must miss something simple and obvious, please help!Create a default controller for "myserver.com", say "home_controller" with an ''index'' action. ./script/generate controller home index Then adjust config/routes.rb to include this near the top: map.connect '''', :controller => "home" Then take the *content* in public/index.html and put it in app/views/home/index.rhtml. Then remove public/index.html. Then make sure it all works :) Once it works, add the following line to your HomeController (outside/above ''dev index''): caches_page :index Then just remember that if you change app/views/home/index.rhtml you need to remove public/index.html. Good luck! -philip --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Roseanne Zhang
2006-Oct-03 22:31 UTC
Re: How to make index.html share with standard-layout.rhtml?
Philip Hallstrom wrote:> > Create a default controller for "myserver.com", say "home_controller" > with > an ''index'' action. > > ./script/generate controller home index >Thank you very much for your reply, I will try it now. Roseanne -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---