From: Daniel Mendler Date: 2008-03-08T11:32:34+09:00 Subject: do-end-blocks Hi! Why is this code invalid? respond_to do |format| format.html format.xml { render :xml => @books } format.js { render :update { |p| p.replace_html 'books_table', :partial => 'books' } } # <--- end ...and this code valid? respond_to do |format| format.html # search.html.erb format.xml { render :xml => @books } format.js { render :update do |p|; p.replace_html 'books_table', :partial => 'books'; end } end I do not understand when to use do-end blocks and when to use bracket constructs. According to the documentation they are equivalent... Daniel