Render question

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

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.

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.

Yikes, that looks horrible :wink: 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.