I am struggling with a strange effect when using two partials This is show.html.erb <div> <h2>posts commented on by <%= @user.login %></h2> <%= render :partial => @posts_commented_on %> <h2>Posts submitted by <%= @user.login %></h2> <%= render :partial => @posts_submitted %> </div> This is the relevant bit of users.html.erb <div id="useryield"> <%= yield %> </div> This is from users_controller.rb def show @user = User.find(params[:id]) @posts_submitted = @user.posts.find(:all, :limit => 6, :order => ''posts.id DESC'') @posts_commented_on = @user.posts_commented_on.find(:all, :limit => 2, :order => ''comments.id DESC'') end Can anybody tell me where the div, that splits submitted from comments, appears from? Attachments: http://www.ruby-forum.com/attachment/4737/Screenshot.png -- 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 May 16, 6:09 pm, Neil Bye <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Can anybody tell me where the div, that splits submitted from comments, > appears from?What does the post partial & generated html look like ? Could you have forgotten to close a tag or something like that ? Fred> > Attachments:http://www.ruby-forum.com/attachment/4737/Screenshot.png > > -- > Posted viahttp://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@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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.
Frederick Cheung wrote:> On May 16, 6:09�pm, Neil Bye <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> Can anybody tell me where the div, that splits submitted from comments, >> appears from? > > What does the post partial & generated html look like ? Could you have > forgotten to close a tag or something like that ? > > FredHope this helps I''ve attached the generated html. The partials are defined in this extract from user_controller.rb def show @user = User.find(params[:id]) @posts_submitted = @user.posts.find(:all, :limit => 6, :order => ''posts.id DESC'') @posts_commented_on = @user.posts_commented_on.find(:all, :limit => 2, :order => ''comments.id DESC'') end How can it create a div in the middle of a find operation? Attachments: http://www.ruby-forum.com/attachment/4739/index.html.erb -- 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, May 17, 2010 at 7:47 AM, Neil Bye <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Frederick Cheung wrote: >> On May 16, 6:09�pm, Neil Bye <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >>> Can anybody tell me where the div, that splits submitted from comments, >>> appears from? >> >> What does the post partial & generated html look like ? Could you have >> forgotten to close a tag or something like that ? >> >> Fred > Hope this helps > > I''ve attached the generated html. > The partials are defined in this extract from user_controller.rb > def show > @user = User.find(params[:id]) > @posts_submitted = @user.posts.find(:all, > :limit => 6, :order => ''posts.id DESC'') > @posts_commented_on = @user.posts_commented_on.find(:all, > :limit => 2, :order => ''comments.id DESC'') > end > How can it create a div in the middle of a find operation? > > Attachments: > http://www.ruby-forum.com/attachment/4739/index.html.erbLet''s look at the first post from that <h2>posts commented on by gleb</h2> <div class="post" id="post_6"> <h3><a href="/posts/6">Nathan''s tail</a></h3> <p class="content"> Hi, I am a dog. Woof,woof </p> <p class="new"> <em>Please log in to place a comment.</em> <a href="/session/new">Login</a> </p> </div> <p> Submitted by: <a href="/users/4">rover</a> </p> </div> You have one <div> tag and two </div> tags, which isn''t balanced. This appears to be consistent for each post. I would guess you want that last closing div tag and not the one 4 lines above. I suspect that this is in _post.html.erb HTH --- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Github: http://github.com/rubyredrick Twitter: @RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale -- 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.
You were right, stupid of me. Thanks -- 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.