D
Daniel Mendler
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',
artial => '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',
artial => '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
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',
artial => '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',
artial => '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