you are in: codestackercodes [RSS] → tag: render [RSS]

render view without layout in ajax requests Delicious Email

http://jamiedubs.com/always-render-rails-views-without-the-full-layout-when-using-ajax-degradable-javascript

paste in application controller and forgot ‘render :layout => false if request.xhr?’

show/hide lines
   1    def render(*args)
   2      args.first[:layout] = false if request.xhr? and args.first[:layout].nil?
   3    	super
   4    end
created by leozera — 15 January 2009 — get a short url — tags: ajax rails render ruby embed