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?
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?
<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>