Forum: Ruby on Rails ajax problem

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
kevin.jackson (Guest)
on 2005-11-12 12:49
(Received via mailing list)
Hi All,

I have an element in a table, and on a callback after an AJAX call I'd
like to change the font-style of the text in the element.

I currently have

Calling view
 <div id='<%= %>'>
    <td align="left" valign="top"><%= link_to position.job_title,
:action => 'show', :id => position %></td>
    <td align="left" valign="top"><%= position.salary %></td>
    <td align="left" valign="top"><%= position.location %></td>
    <td align="left">
    <td align="left" rowspan="5" colspan="3"><%= position.description
    <tr><td><%= link_to 'Edit', :action => 'edit', :id => position
    <tr><td><%= link_to 'Destroy', { :action => 'destroy', :id =>
position }, :confirm => 'Are you sure?' %></td></tr>
    <tr><td><%= link_to_remote('close',
                :update => "#{}",
                 :url => { :action => :close, :id => position },
                :confirm => 'Are you sure you wish to close this
                :complete => <do something?> %></td></tr>
    <tr><td><%= link_to 'apply', { :action => 'apply', :id => position
}, :confirm => 'Are you sure you wish to apply for this position?'

  def close
    position = Position.find(params[:id])
      render(:layout => false)

returned view

<%= update_element_function(
  '1', :action => :update, <something?>
) %>

I've been trying to track this down for a while now and I can't find an
example of anything similar.  Does anyone have an example of something
that manipulates the original text of the div?  Most examples of
link_to_remote seem to add text, I haven't seen anything that alters the
text style

t.fuchs (Guest)
on 2005-11-12 12:49
(Received via mailing list)
You don't want the :update => 'element_id' parameter in that case (as
you're not going to update the contents of the element).

You want

	:complete => "$('#{}").style.textDecoration = 'line-

without the :update stuff. (note this is from memory, untested!).


Am 09.11.2005 um 11:22 schrieb Kev Jackson:
This topic is locked and can not be replied to.