90 words — 1 minutes read

Textmate Footnotes and RJS render calls don't mix

Maybe this saves you a couple of hours of frustration:

def syslog_progress
  if request.xhr?
    worker = MiddleMan.get_worker(session[:host_info])
    progress_percent = worker.progress
    render :update do |page|
      page.call('progressPercent', 'progressbar', progress_percent)
      if progress_percent >= 100
        page.assign 'stop_polling', true  
      end
    end
  else
    redirect_to :action => 'list'
  end
end

The RJS calls didn’t execute at all and the excessive use of “alert()” to debug neither. Finally, looking at the response in FireBug I saw that the TextMate Footnote plugin was adding it’s links to the response, rendering the Javascript invalid.

Technorati Tags: development, debugging, rails, rubyonrails

Jens-Christian Fischer

Maker. Musician