Hi Tim,

Tim Conner wrote:

>  The partial that needs to be rendered after the update action
> is dependent on where the AJAX call is made from.

The easy way to handle this is simply to pass a param, probably via a
hidden_field_tag, that tells you from which partial the method was called.
There's nothing unRESTful about this.  The only downside is that it'll push
you to do your rendering in the controller rather than just letting Rails
render the default view.  Nothing really wrong with that either though.  The
method will look something like...

def update
   respond_to do |format|
      format.js {
         if params[:called_from] == 'show'
            render_update do |page|
                page.replace_html ...
            end
         elsif params[:called_from] ==  'list'
            render_update do |page|
                page.replace_html ... something else
            end
         else
             #might want to do some error trapping here
         end
       }
    end
end

HTH,
Bill


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to