Tony Tony
2009-Mar-06 03:20 UTC
Can map.root to point to a static html file in public dir?
Hi all, I''m trying to get map.root to point to a static html file in the public directory. I can''t just have index.html since I''m doing subdomains and any index.html file in there will be used as the actual page displayed. Basically I can point to my subdomain roots just fine, but I need to find a way to point map.root to a specific html file. For example, something like this: map.root :url => ''homepage.html'' That example doesn''t work obviously. Any input would be greatly appreciated. If you need any more info, please let me know! Thanks. -Tony -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder
2009-Mar-06 15:21 UTC
Re: Can map.root to point to a static html file in public dir?
On Thu, Mar 5, 2009 at 7:20 PM, Tony Tony <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m trying to get map.root to point to a static html file in the public > directory. I can''t just have index.html since I''m doing subdomains and > any index.html file in there will be used as the actual page displayed.Sorry, missing something here -- What''s the difference between using static file "index.html" and static file "homepage.html"? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Tony Tony
2009-Mar-06 15:37 UTC
Re: Can map.root to point to a static html file in public d
Hassan Schroeder wrote:> On Thu, Mar 5, 2009 at 7:20 PM, Tony Tony > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> I''m trying to get map.root to point to a static html file in the public >> directory. I can''t just have index.html since I''m doing subdomains and >> any index.html file in there will be used as the actual page displayed. > > Sorry, missing something here -- > > What''s the difference between using static file "index.html" and static > file "homepage.html"? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.orgHi Hassan, Rails automatically picks up ''index.html'' as the root page for the site. Whether it''s a subdomain (ex. user.app.com) or the actual domain (app.com), if the ''index.html'' is present then it is picked up as the root. What I want is to have my subdomain root (ex. user.app.com) to point to the user login page (which I currently have working) and the domain root (ex. app.com) to have a typical welcome/signup index page. This index page is going to be 100% static so I''d prefer to just have it as a file (say homepage.html) in the public directory. I realize I could get this working by creating a ''page'' controller and view and then direct map.root to that specific controller/view but I think cutting down on unnecessary rails calls would be best. Any help is appreciated, thanks! -Tony -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Hassan Schroeder
2009-Mar-06 16:53 UTC
Re: Can map.root to point to a static html file in public d
On Fri, Mar 6, 2009 at 7:37 AM, Tony Tony <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> What I want is to have my subdomain root (ex. user.app.com) to point to > the user login page (which I currently have working) and the domain root > (ex. app.com) to have a typical welcome/signup index page. This index > page is going to be 100% static so I''d prefer to just have it as a file > (say homepage.html) in the public directory. I realize I could get this > working by creating a ''page'' controller and view and then direct > map.root to that specific controller/view but I think cutting down on > unnecessary rails calls would be best.Perhaps someone else will chime in with an alternative, but I think fighting this convention will be more trouble than its worth :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Tony Tony
2009-Mar-06 17:26 UTC
Re: Can map.root to point to a static html file in public d
Hassan Schroeder wrote:> On Fri, Mar 6, 2009 at 7:37 AM, Tony Tony > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> What I want is to have my subdomain root (ex. user.app.com) to point to >> the user login page (which I currently have working) and the domain root >> (ex. app.com) to have a typical welcome/signup index page. This index >> page is going to be 100% static so I''d prefer to just have it as a file >> (say homepage.html) in the public directory. �I realize I could get this >> working by creating a ''page'' controller and view and then direct >> map.root to that specific controller/view but I think cutting down on >> unnecessary rails calls would be best. > > Perhaps someone else will chime in with an alternative, but I think > fighting this convention will be more trouble than its worth :-) > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.orgIt''s starting to look that way! Hopefully there''s someone that knows of a good quick solution. Thanks for the reply though, I appreciate it. -Tony -- 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Conrad Taylor
2009-Mar-06 17:26 UTC
Re: Can map.root to point to a static html file in public d
On Fri, Mar 6, 2009 at 8:53 AM, Hassan Schroeder <hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > On Fri, Mar 6, 2009 at 7:37 AM, Tony Tony > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > What I want is to have my subdomain root (ex. user.app.com) to point to > > the user login page (which I currently have working) and the domain root > > (ex. app.com) to have a typical welcome/signup index page. This index > > page is going to be 100% static so I''d prefer to just have it as a file > > (say homepage.html) in the public directory. I realize I could get this > > working by creating a ''page'' controller and view and then direct > > map.root to that specific controller/view but I think cutting down on > > unnecessary rails calls would be best. > > Perhaps someone else will chime in with an alternative, but I think > fighting this convention will be more trouble than its worth :-) > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org >Hi, when someone goes to app.com, you would like it to go to the homepage.html. Thus, you can do one of the following: a) Apache i) Update the following in your httpd.conf file: <IfModule dir_module> DirectoryIndex index.html index.htm index.php homepage.html </IfModule> ii) Upload the file (i.e. homepage.html) to public directory of your Rails application. Note: This should do the job for you. b) Rails Caching i) Turn page caching on for a view template (i.e. homepage.html.erb) and ii) update you map.root map.root :controller => "index", :action => "homepage" Note: This will cache the static content (i.e. homepage.html) within your public folder. Thus, it will be served by Apache or the web server that you''re using. In short, the standard way of providing the root page of a web site is to use an index.[php|html|htm|...] but feel free to use one of the methods above to achieve your result. Good luck, -Conrad --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Tony Tony
2009-Mar-06 17:42 UTC
Re: Can map.root to point to a static html file in public d
Conrad Taylor wrote:> In short, the standard way of providing the root page of a web site is > to > use an index.[php|html|htm|...] but feel free to use one > of the methods above to achieve your result. > > Good luck, > > -ConradFANTASTIC! Thanks a lot for the detailed post. -Tony -- 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?hl=en -~----------~----~----~----~------~----~------~--~---