Rendering a chosen RJS

June 22nd, 2006

Of course to render a rjs that has a name different from the controller method, we must use the :action specifier. For example we could have something like:

    respond_to do |wants|
      wants.html {render  :partial=>"post", :object=>@post, :layout=>'posts'}
      wants.js   {render  :action=>"remote_show"}
    end

Although this is pretty obvious if you reason about it, you may need some time to get it. And on the net there aren’t easily accessible examples about it (or at least I found none).

It’s just a dirty trick.

Programming, Ruby | Comments | Trackback

Leave a Reply

  1.  
  2.  
  3.  
  4. XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>
You can keep track of new comments to this post with the comments feed.

Recent Posts

Blogroll

Siti amici

Misc

Recent Comments

Categories

Enrico Franchi graduated in Maths and Computer Science and is now studying for a Computet Science MSc (though because of italian bureaucracy that very course is to be cancelled).

RiK0's Tech Temple is using WP-Gravatar