# Form\_remote\_tag/partials/cycle

**URL:** <https://www.ruby-forum.com/t/form-remote-tag-partials-cycle/120446>\
**Category:** Rails\
**Created:** [November 17, 2007, 12:17am UTC](https://www.ruby-forum.com/t/form-remote-tag-partials-cycle/120446 "2007-11-17T00:17:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![corywilkerson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/aca169/32.png) [@corywilkerson](https://www.ruby-forum.com/u/corywilkerson)\
**Post date:** [November 17, 2007, 12:17am UTC](https://www.ruby-forum.com/t/form-remote-tag-partials-cycle/120446/1 "2007-11-17T00:17:20Z")

</div>

All,

Running into a small issue that I’m not sure how to eloquently resolve.  
I have a partial that reads something similar to:  
[http://pastebin.com/m16c4295e](http://pastebin.com/m16c4295e)…

The problem is when I invoke this partial from an action (kicked off by  
a form\_remote\_tag)…

* * *

## if @comment.save render :partial =\> ‘comment’ else render :partial =\> ‘invalid\_comment’, :status =\> 444 end

So, given three ‘comments’, I’ll see the following styles:  
‘comment’/‘comment alt’/‘comment’, however, when I go to add another  
comment, the partial is invoked with no context and thusly uses the  
first item in the cycle - ‘comment’ which effectively breaks the css  
layout.

Clearly what I’m wanting to accomplish is:  
comment  
comment alt  
comment  
comment alt

But instead I’m having to deal with  
comment  
commment alt  
comment  
comment

Any suggestions on how to cycle my styles after a remote/partial update?  
I guess I could write some js to clean things up but I’m sure I’m  
missing something.

Help and thanks.
