Saturday, 14 July 2012

Coffescript rendering

The correct way to render html inside your XHR response in Rails.

  app.showFlashMessages('<%=j flash_messages %>')
  $('.booking').replaceWith( '<%=j render @booking %>' )
  app.myFunction( <%=raw array.map(&:to_json) %> ) # TODO: double check

No comments:

Post a Comment