diff options
author | Bob Remeika <bob.remeika@gmail.com> | 2009-09-23 15:06:56 -0700 |
---|---|---|
committer | Stefan Penner <stefan.penner@gmail.com> | 2010-01-27 12:44:28 -0600 |
commit | 88e793e5e77efbd43a5a2bb4eaba283255f6a262 (patch) | |
tree | 0526bdc0747f0cb444a730a721d8e390eacfab79 /actionpack/lib/action_view | |
parent | fab8b25c15064a020e62e2baca11ed1f551f4d6f (diff) | |
download | rails-88e793e5e77efbd43a5a2bb4eaba283255f6a262.tar.gz rails-88e793e5e77efbd43a5a2bb4eaba283255f6a262.tar.bz2 rails-88e793e5e77efbd43a5a2bb4eaba283255f6a262.zip |
Changed the observe field node into a div with display:none
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/helpers/ajax_helper.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/actionpack/lib/action_view/helpers/ajax_helper.rb b/actionpack/lib/action_view/helpers/ajax_helper.rb index 3be8878f97..6a13bcb432 100644 --- a/actionpack/lib/action_view/helpers/ajax_helper.rb +++ b/actionpack/lib/action_view/helpers/ajax_helper.rb @@ -38,12 +38,17 @@ module ActionView url = options.delete(:url) url = url_for(url) if url.is_a?(Hash) - if frequency = options.delete(:frequency) + frequency = options.delete(:frequency) + if frequency && frequency > 0 html_options[:"data-frequency"] = frequency end - html_options.merge!(:"data-observe" => true, :"data-url" => url) - tag(:input, html_options) + html_options.merge!(:style => "display:none", + :"data-observe-field" => name, + :"data-observe" => true, + :"data-url" => url) + + tag(:div, html_options) end module Rails2Compatibility |