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

render view without layout in ajax requests

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?'

  def render(*args)
    args.first[:layout] = false if request.xhr? and args.first[:layout].nil?
  	super
  end
Displaying 1 Code