# Mixing a call to .rhtml AND .rjs

**URL:** <https://www.ruby-forum.com/t/mixing-a-call-to-rhtml-and-rjs/114523>\
**Category:** Rails\
**Created:** [September 13, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/mixing-a-call-to-rhtml-and-rjs/114523 "2007-09-13T21:42:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeannibee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@jeannibee](https://www.ruby-forum.com/u/jeannibee)\
**Post date:** [September 13, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/mixing-a-call-to-rhtml-and-rjs/114523/1 "2007-09-13T21:42:04Z")

</div>

Hi

I’ll admit that I’m being lazy and trying to avoid learning enough  
javascript to implement this in [Script.aculo.us](http://Script.aculo.us), but if I have to I  
will.

If I don’t then someone will have answered this question I have. 😉

I have an .rhtml being rendered but I want to also ‘flash’ a

  
element on the screen that matches a criteria, this page is NOT being  
updated via ajax.

Any clue?

thanks.

---

<div class="post-metadata">

**Author:** ![jeannibee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@jeannibee](https://www.ruby-forum.com/u/jeannibee)\
**Post date:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/mixing-a-call-to-rhtml-and-rjs/114523/2 "2007-09-17T13:25:21Z")

</div>

I’m not sure I have enough information about what you are trying to do,  
but do you mean that you want to put flash data into a div if certain  
criteria is true at the time the page is rendered? If so, you could just  
do this in your .rhtml file:  
…  
\<% if condition -%\>

\<%= flash[:error] -%\>
\<% end -%\> ...

If you are wanting to do something after the page is rendered based on  
user interaction, that would need to be done w/ javascript.

-Bill

Jean N. wrote:

> updated via ajax.
> 
> Any clue?
> 
> thanks.

–  
Sincerely,

William P.

---

<div class="post-metadata">

**Author:** ![jeannibee](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/85e7bf/32.png) [@jeannibee](https://www.ruby-forum.com/u/jeannibee)\
**Post date:** [September 17, 2007, 1:25pm UTC](https://www.ruby-forum.com/t/mixing-a-call-to-rhtml-and-rjs/114523/3 "2007-09-17T13:25:35Z")

</div>

I think what you want to do is this:

Watch me highlight!

cheers

Ivor
