Good morning, I just started a new application and was wondering what the best practice for root (-> http://localhost:3000/) is. My landing page is going to load data from 5 different models and I don''t really know if I should put a "welcome" action in one of these 5 controllers or create something like a home/welcome controller. Any suggestions, opinions are highly appreciated. Thank you -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 16/01/11 09:34, Heinz Strunk wrote:> Good morning, > > I just started a new application and was wondering what the best > practice for root (-> http://localhost:3000/) is. My landing page is > going to load data from 5 different models and I don''t really know if I > should put a "welcome" action in one of these 5 controllers or create > something like a home/welcome controller. > > Any suggestions, opinions are highly appreciated. > > Thank you >Hi Heinz, I usually create a controller home with an index action for this purpose, and I guess this is what the majority of Rails developers do. When I began developing in Rails I have also experienced this dilemma, but then I found this model in the majority of the books I have read. Hope this helps you get started. Best Regards, Fidel. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Yes it does, thanks Fidel! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 16/01/11 11:23, Heinz Strunk wrote:> Yes it does, thanks Fidel! >Hi Hanz, Also don''t forget to create a route in your routes.rb file. In Rails 3, you map it like this: root :to => "home#index" In prior versions you do it like this: map.root :controller => "home", :action => "index" This will load your default controller with its respective action whenever you type http://localhost:3000 or http://yourdomainname. And don''t forget to remove the file public/index.html. If you don''t remove it, you will continue seeing the Rails default home page. Best Regards, Fidel. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Working like a charm already, thanks a lot! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.