Sha256: 9e0029e9911f2080ecabef79ca8dba4fcf201657484e07c997fc0f46d88bb6bd

Contents?: true

Size: 678 Bytes

Versions: 14

Compression:

Stored size: 678 Bytes

Contents

require 'rails'

module Prime
  module Rails     
    module Utils
      
      protected
      
      def p_ajax_resp(options = {})
        options = options.stringify_keys
        output = "<partial-response>"
        output += "<changes>"
    
        options['update'] = {} if !options.has_key?('update')
        options['update'].each do |update| 
          update = update.stringify_keys
          updateid = update['id']
          updateresp = update['resp']
          output += %{<update id="#{updateid}"><![CDATA[#{updateresp}]]></update>}
        end
    
        output += "</changes>"
        output += "</partial-response>"
      end       
      
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
prime-rails-0.0.16 lib/prime/rails/utils.rb
prime-rails-0.0.15 lib/prime/rails/utils.rb
prime-rails-0.0.14 lib/prime/rails/utils.rb
prime-rails-0.0.13 lib/prime/rails/utils.rb
prime-rails-0.0.12 lib/prime/rails/utils.rb
prime-rails-0.0.11 lib/prime/rails/utils.rb
prime-rails-0.0.10 lib/prime/rails/utils.rb
prime-rails-0.0.9 lib/prime/rails/utils.rb
prime-rails-0.0.8 lib/prime/rails/utils.rb
prime-rails-0.0.7 lib/prime/rails/utils.rb
prime-rails-0.0.6 lib/prime/rails/utils.rb
prime-rails-0.0.5 lib/prime/rails/utils.rb
prime-rails-0.0.4 lib/prime/rails/utils.rb
prime-rails-0.0.3 lib/prime/rails/utils.rb