Permalink
Browse files

fixing 'Ajax is not defined' bug

  • Loading branch information...
1 parent 8a9d596 commit b41b8667bd1243b5e92b96e725d8db9b94dbcaf3 rafaelmacedo committed May 12, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/facebox_render_helper.rb
View
4 lib/facebox_render_helper.rb
@@ -1,7 +1,7 @@
module FaceboxRenderHelper
- def facebox_link_to(name, options = {}, html_options = nil)
- link_to_function(name, "jQuery.facebox(function(){ #{remote_function(options)} })", html_options || options.delete(:html))
+ def facebox_link_to(name, options = {}, html_options = nil)
+ link_to_function(name, "jQuery.facebox(function(){ jQuery.ajax({data:'authenticity_token=' + encodeURIComponent('#{options[:authenticity_token]}'), dataType:'script', type:'#{options[:method]}', url:'#{options[:url]}'})})", html_options || options.delete(:html))
end
end

0 comments on commit b41b866

Please sign in to comment.