Hey! I''m a bit new to Rails and I wonder how one render both the new controller and the index on the same page. For example: <h1>Guestbook</h1> (new) #post a new entry (index) #showing all posts I do not want to go to a separate new page. Thank you for the time! -- 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.
2009/12/21 Manus <manusdude-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> Hey! > > I''m a bit new to Rails and I wonder how one render both the new > controller and the index on the same page. > For example: > > <h1>Guestbook</h1> > (new) #post a new entry > (index) #showing all posts > > I do not want to go to a separate new page.There is nothing stopping you showing a form for entering a new record on the same page as the index. The view erb file merely has to show the form and the index. Use partials for the two sections so you can use the same partials individually if you want just one or the other. Colin -- 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.
Okej! I suspected it would be done that way. Thank you for the time once again! On Dec 21, 2:24 pm, Colin Law <clan...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 2009/12/21 Manus <manusd...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > Hey! > > > I''m a bit new to Rails and I wonder how one render both the new > > controller and the index on the same page. > > For example: > > > <h1>Guestbook</h1> > > (new) #post a new entry > > (index) #showing all posts > > > I do not want to go to a separate new page. > > There is nothing stopping you showing a form for entering a new record > on the same page as the index. The view erb file merely has to show > the form and the index. Use partials for the two sections so you can > use the same partials individually if you want just one or the other. > > Colin-- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.