Syntax problem or something else?

Hi, I'm pretty sure this is a simple problem but I can't seem to work it
out.
I have a series of news stories and I would like the body of the story
to be displayed (using a visual_effect toggle) when the user clicks on
the title.

The toggle works ok, but it does not matter which title I click on, only
the first story is ever displayed.

Can anyone see what is the problem?
Thanks

<h2>Latest News</h2>
<% for newsitem in @newsitems %>
    <div class="item">
      <h2><%= link_to newsitem.title, "#", :onclick =>
visual_effect(:toggle_appear, ('newsitem.id'), :duration => 0.5) %>
</h2>

<div id="<%= ('newsitem.id') %>" style="display:none">
<h6><%= newsitem.created_at.strftime('%a %d %b %Y, %I:%M%p') %> by <%=
newsitem.user.login %></h6>

<p><%= newsitem.body %></p>
</div>
</div>
<% end %>

Hi, I'm pretty sure this is a simple problem but I can't seem to work it
out.
I have a series of news stories and I would like the body of the story
to be displayed (using a visual_effect toggle) when the user clicks on
the title.

The toggle works ok, but it does not matter which title I click on, only
the first story is ever displayed.

Your problem (which you should be able to see if you looked at the
html) is that all of your divs have as id the string newsitem.id.
When you write ('newsitem.id') (not sure what you were trying to
accomplish with the parentheses no interpolation is taking place,
that's just a string literal.
if you want interpolation then you need to use double quotes and #{}
to indicate what should be interpolated, eg "my name is #{ name } "

Fred

Try replacing
visual_effect(:toggle_appear, ('newsitem.id'), :duration => 0.5) with
visual_effect(:toggle_appear, "#{newsitem.id}", :duration => 0.5)

and

<div id="<%= ('newsitem.id') %>" style="display:none"> with
<div id="<%= newsitem.id %>" style="display:none">

The way you have it is the literal string 'newsitem.id'.
"#{newsitem.id}" and <%= newsitem.id %> should resolve to what you
want, the id of the item.