I''d like to point to my site url and have a dynamic page instead of my static public/index.html, but I can''t figure out how to do it ... I don''t need a controller, I only need to check if a user has logged in. Well... it would be great to have the possibility to use a layout and all other "view" facilities that Rails provides, but actually the only thing I need is to render a rhtml page as my index. Someone ? TIA, ngw -- checking for life_signs in -lKenny... no Oh my god, make (1) killed Kenny ! You, bastards ! nicholas_wieland-at-yahoo-dot-it
Nicholas Wieland wrote:> I''d like to point to my site url and have a dynamic page instead of my > static public/index.html, but I can''t figure out how to do it ... I > don''t need a controller, I only need to check if a user has logged in. > Well... it would be great to have the possibility to use a layout and > all other "view" facilities that Rails provides, but actually the only > thing I need is to render a rhtml page as my index. > Someone ?If you are using Apache check out .htaccess. You should see something like: # Enable this rewrite rule to point to the controller/action that should serve root. # RewriteRule ^$ /controller/action [R] Simply uncomment and put the controller and action you want to direct to. If the action is index than you can leave off the action part. Eric _______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Nicholas Wieland wrote:>I''d like to point to my site url and have a dynamic page instead of my >static public/index.html, but I can''t figure out how to do it ... I >don''t need a controller, I only need to check if a user has logged in. >Well... it would be great to have the possibility to use a layout and >all other "view" facilities that Rails provides, but actually the only >thing I need is to render a rhtml page as my index. >Someone ? > >TIA, > ngw > > >Give this a shot http://wiki.rubyonrails.com/rails/show/HowtoConfigureTheDefaultPageForYourRailsApp -Matt Margolis
- Eric Anderson :> >I''d like to point to my site url and have a dynamic page instead of my > >static public/index.html, but I can''t figure out how to do it ... I > >don''t need a controller, I only need to check if a user has logged in. > >Well... it would be great to have the possibility to use a layout and > >all other "view" facilities that Rails provides, but actually the only > >thing I need is to render a rhtml page as my index. > >Someone ? > > If you are using Apache check out .htaccess. You should see something like: > > # Enable this rewrite rule to point to the controller/action that should > serve root. > # RewriteRule ^$ /controller/action [R] > > Simply uncomment and put the controller and action you want to direct > to. If the action is index than you can leave off the action part.I see, thanks Eric and Matthew for the suggestion. Maybe it would be good to have layouts and helpers for public/index.html, it''s something like a view of the whole site, without a particular controller or model to use, an overview, and sometimes it "aggregates" from different controllers and models, for example if I have to check if a user has logged in and display site news. What do you think ? TIA, ngw -- checking for life_signs in -lKenny... no Oh my god, make (1) killed Kenny ! You, bastards ! nicholas_wieland-at-yahoo-dot-it
Keep in mind you have ApplicationController and ApplicationHelper to stick global stuff in. You can also make a ''home'' controller if neccesary. If you write your partials well in the other controllers, you can use them to make sections that can be ''plugged in'' to your home page. For instance, in an store application, I have a _shortitem.rhtml partial under app/views/item. So I can ask the item model for the top 10 items or whatever, then use render_collection_of_partials right in the front page code to view them. I think the ingredients are here already to make for a good front page, however dynamic. It''s a little unnatural with the controller/action/id URL format to try and make /public/index.html dynamic...probably just better to give the home page its own controller/action as you see fit. Brian On Wed, 19 Jan 2005 10:46:39 +0100, Nicholas Wieland <nicholas_wieland-whZMOeQn8C0@public.gmane.org> wrote:> - Eric Anderson : > > >I''d like to point to my site url and have a dynamic page instead of my > > >static public/index.html, but I can''t figure out how to do it ... I > > >don''t need a controller, I only need to check if a user has logged in. > > >Well... it would be great to have the possibility to use a layout and > > >all other "view" facilities that Rails provides, but actually the only > > >thing I need is to render a rhtml page as my index. > > >Someone ? > > > > If you are using Apache check out .htaccess. You should see something like: > > > > # Enable this rewrite rule to point to the controller/action that should > > serve root. > > # RewriteRule ^$ /controller/action [R] > > > > Simply uncomment and put the controller and action you want to direct > > to. If the action is index than you can leave off the action part. > > I see, thanks Eric and Matthew for the suggestion. > Maybe it would be good to have layouts and helpers for public/index.html, > it''s something like a view of the whole site, without a particular > controller or model to use, an overview, and sometimes it "aggregates" > from different controllers and models, for example if I have to check if > a user has logged in and display site news. > What do you think ? > > TIA, > ngw > -- > checking for life_signs in -lKenny... no > Oh my god, make (1) killed Kenny ! You, bastards ! > > nicholas_wieland-at-yahoo-dot-it > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- The years ahead pick up their dark bags. They move closer. There''s a slight rise in the silence then nothing. -- (If you''re receiving this in response to mail sent to bluczkie-OM76b2Iv3yLQjUSlxSEPGw@public.gmane.org, don''t be concerned This is my new address, but mail will be forwarded here indefinitely)