# Render question

**URL:** <https://www.ruby-forum.com/t/render-question/121415>\
**Category:** Rails\
**Created:** [November 27, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/render-question/121415 "2007-11-27T19:38:52Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [November 27, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/render-question/121415/1 "2007-11-27T19:38:52Z")

</div>

Earlier I ask how I could basically do two things at once - have an  
error message display then had a list of saved stuff display. Now I  
would like to, instead, have a alert box come up and say something but  
still render this list of saved membership numbers. I have something  
like this:

render :partial =\> ‘airline\_links’, :text =\> ‘alert(‘Invalid Credit Card  
Number.’);’

It doesn’t complain but my partial doesn’t show up either but my pop-up  
alert box does. Is there a way to do both? Thanks,

-S

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [November 27, 2007, 7:56pm UTC](https://www.ruby-forum.com/t/render-question/121415/2 "2007-11-27T19:56:01Z")

</div>

You will need to use rjs to update multiple elements on a page.

-Bill

Shandy N. wrote:

> It doesn’t complain but my partial doesn’t show up either but my pop-up  
> alert box does. Is there a way to do both? Thanks,
> 
> -S

–  
Sincerely,

William P.

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [November 27, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/render-question/121415/3 "2007-11-27T23:09:35Z")

</div>

William P. wrote:

> You will need to use rjs to update multiple elements on a page.
> 
> -Bill
> 
> Shandy N. wrote:
> 
> > It doesn’t complain but my partial doesn’t show up either but my pop-up  
> > alert box does. Is there a way to do both? Thanks,
> > 
> > -S
> 
> –  
> Sincerely,
> 
> William P.

I did do it by using render :inline

render :inline =\> ’  
\<% for @rentalcar in @user.rentalcarinfos %\>  
\<% mystring =  
@rentalcar.membership\_num[@rentalcar.membership\_num.length -  
4, 4]%\>

**\<%= @rentalcar.company %\>:** ----------\<%= mystring %\> \<%= link\_to\_remote \'Delete\', :url =\> { :action =\> \'delete\_rental\_car\', :id =\> @user.id, :rentalcar =\> @rentalcar.id }, :update =\> \'add\_rentalcar\_info\' %\>

\<% end %\> '

It’s not pretty but it does do what I want it to do.

---

<div class="post-metadata">

**Author:** ![snantz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c2a13f/32.png) [@snantz](https://www.ruby-forum.com/u/snantz)\
**Post date:** [November 27, 2007, 11:26pm UTC](https://www.ruby-forum.com/t/render-question/121415/4 "2007-11-27T23:26:01Z")

</div>

Yikes, that looks horrible 😉 You should read up on rjs. It’s quite  
easy, really powerful, and much, much cleaner.

-Bill

Shandy N. wrote:

> > >
> 
> '
> 
> It’s not pretty but it does do what I want it to do.

–  
Sincerely,

William P.
