Glen
February 13, 2008, 2:41am
1
After submitting a post via an Ajax form the update on the div is
rendered completely wrong. A simple reload of the page fixes the
render but that is in no way acceptable. Does anyone have any idea
what would be causing this?
Here is the render call:
render :partial => "conversations/post", :layout => false
I’ve tried it with the layout and without, it has absolutely no
effect.
Here is “conversations/post”:
<% for post in @posts %>
<%=h User.find(post.user_id).login %>
Posts: <%=h User.find(post.user_id).num_posts %>
<td class="message">
<% if post.title %>
<b><%=h post.title %></b><br /><br/>
<% end %>
</td>
</tr>
<tr>
<td>
</td>
<td style="text-align: left;">
<%=h post.body %>
</td>
</tr>
<% end %>
<tr>
<div id="new_post">
<%= link_to_remote 'New Post',
:url => new_forum_post_url(:id => @conversation.id),
:update => 'new_post' %>
</div>
</tr>
</tbody>
</table>
<div id="forum_ads">
More Ad Sense would go here
</div>
<br />
<br />
<br />
<%= link_to 'Back', :controller => 'forums', :action =>
‘show’, :id => session[:forum] %>