On Mon, May 17, 2010 at 7:47 AM, Neil Bye <[email protected]> wrote:
> Frederick Cheung wrote:
>> On May 16, 6:09�pm, Neil Bye <[email protected]> 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.erb

Let'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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to