# Fader Issues

**URL:** <https://www.ruby-forum.com/t/fader-issues/185933>\
**Category:** Rails\
**Created:** [March 29, 2010, 1:30pm UTC](https://www.ruby-forum.com/t/fader-issues/185933 "2010-03-29T13:30:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [March 29, 2010, 1:30pm UTC](https://www.ruby-forum.com/t/fader-issues/185933/1 "2010-03-29T13:30:06Z")

</div>

What I want is to be able to fade an Image from a News Story with the  
summary text. Both from the same record, from the same database table.  
I’ve placed the fader into a seperate partial that’s being rendered on  
an index page. I’ve included the proper javascript files in the proper  
location and included them in my layout.

 \<% id = 0 %\> \<% for article in @all\_articles %\> \<%= scale\_image\_tag article.picture1, :width =\> 137, :height =\> 153, :alt =\> article.picture1.image\_alt, :id =\> "article\_image\_" + id.to\_s, :style =\> (article == @all\_articles.first ? "": "display:none;") %\> \<% id += 1 %\> \<% end %\> 
 \<% id = 0 %\>

\<% for article in @all\_articles %\>  
\<p class=“slideshow\_text” id=“article\_summary\_\<%= id.to\_s %\>”  
style="\<%= (article == @all\_articles.first ? “”: “display:none;”)  
%\>"\>

  

# \<%= link\_to (article.name), :controller =\> “article”, :action =\> “show”, :id =\> article %\>
  
\<%= article.date.strftime("%a %d %B") %\>  

\<%= article.summary[0,75] %\>…

  
\<% id += 1 %\>  
\<% end %\>

The above is immediately run after the javascript declaration.  
Basically, I’m getting the images to fade. Unfortunately, there are two  
News Story records that are highlighted and the above code is displaying  
the two, which is completely understandable after being passed through a  
loop. But I want to know how I can retrieve all the News Stories that  
are highlighted without displaying them and then making the page fade  
the text too.

If you need any more information to respond, please don’t hesitate to  
ask.

- thanks in advance.

---

<div class="post-metadata">

**Author:** ![mercurius](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c89c15/32.png) [@mercurius](https://www.ruby-forum.com/u/mercurius)\
**Post date:** [March 29, 2010, 4:53pm UTC](https://www.ruby-forum.com/t/fader-issues/185933/2 "2010-03-29T16:53:27Z")

</div>

Came back to this. Problem solved.
