similar to: How to safely embed JSON object in HTML document

Displaying 20 results from an estimated 600 matches similar to: "How to safely embed JSON object in HTML document"

2007 Jul 18
2
Hash.from_xml
Hi, I''ve started looking at ticket 90<http://merb.devjavu.com/projects/merb/ticket/90>and there are a couple of situations that the current implementation doesn''t cater for. 1. Tag Attributes are wiped out. - <tag1 attr1=''1''>Content</tag1> #=> { "tag1" => "Content" } - I think it should return -
2011 Jun 15
12
Create or Update Model with JSON?
Having issue updating a model with JSON. I simply *"model.attributes=json"*, which does update the attributes but not the id, or uuid in this case. I want to save or create the record (if it''s id exists). Seems like this would be documented, but I''m not finding anything. I''m using a MOM to pass JSON between apps. Thanks. -- You received this message because
2008 Jun 19
2
Pattern Matching Replacement
I would like to replace "\r\n" with "" in a character string, where "\r\n" exists only between < and >, how could I do that? Initial: characterString = "<XML><tag1 id=\"F\r\n2\"></t\r\nag1>\r\n<tag\r\n2></tag2></XML>" Result: characterString = "<XML><tag1
2010 Jan 18
7
Ruby Array to Java Script Array
Hi, How can we use an array created in Ruby in Java script ? Regards, Prashant -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to
2011 Feb 09
16
rails 3.0.4 broke yield :javascript ?
hello, I have today updated my rails app to 3.0.4 security release but now this yield :javascripts fails in the layout and I get my custom js escaped as text in the view. anybody seeing this also? tia, jk -- www.least-significant-bit.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to
2012 Jul 17
2
puppet host tagging
Hi all . i am running puppet version 2.6.16 and foreman Version 0.4.2 . my question is as follows . i would like to know if there is a way to tag server with a group tagging . for example . let say i am running apache with a unique configuration and network architecture and want to tag in with "tag1" and a i have few more apache installation with the a new unique configuration and
2010 Oct 05
1
Broken support for Smart Card Logon in Windows 2003 and XP
Hello. As I can see this post: https://jira.it.su.se/jira/browse/HEIMDAL-241, at least? Samba 4.0.0alpha5 supported Smart Card logon for Windows XP workstations. Current version (Version 4.0.0alpha14-GIT-77d959f+) does not support smart card logon on Windows XP workstation (but Windows 7 works well). I tried to compare Kerberos traffic examples from genuine domain controller and Samba's
2006 Aug 10
2
search acts_as_taggable for multiple tags
Hey...I''m trying to search a Model that uses acts_as_taggable for multiple tags. I''d like to pass in a search string containing a space delimited tags names (i.e. "tag1 tag2") and return the objects that have been tagged by either one of those. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL:
2006 Nov 14
4
Catching a list of variables with a Controller
Hi All, I have been learning some ruby and some Camping at the same time by implementing a little webapp to track expenses (one man''s blog...) that includes the ability to tag entries with 1 or more tags. I wanted to offer the possibility to narrow the view of expenses by adding tags to a filter (this works) and I also wanted this filter to be reflected in the URL. Like so: normal URL:
2006 May 27
5
ActiveSupport JSON working?
Hi, I am trying to convert a hash to JSON using ActiveSupports built in .to_json. I am doing similar to the example below but are there certain strings that could go in place of ''bar'' or ''rez'' that will break the to_json method? I am using a very long string from rjs output in place of ''bar''. Perhaps .to_json is not ready yet? Thanks, Peter
2006 Apr 28
2
outputing table data
Hi, Just come across thi sproblem, and jsut cant find out what is wrong with it, if any one has any suggestions it would be good. in my projects_controller.rb I have def list @project_pages, @projects = paginate :projects, :per_page => 10 end and ths list.rhtml file I have <table> <tr> <th>Name</th> <th>Actions</th>
2006 Apr 08
5
What is the h for?
In the "Agile Web Development with Rails" book it runs through making an example application, a shopping cart. In one of the views files, there is one line of code I dont understand (below), I dont know what the "h" is for, also I took the h out, and it did not affect the application (as far as i could see). <%= h(product.title) %> Can anyone shed some light on this
2010 Jul 14
3
`stack level too deep` when overwriting `to_json`
I''m using [acts_as_commentable_with_threading](http://github.com/elight/acts_as_commentable_with_threading/), and it worked fine until I tried to overwrite the to_json function to include more details about the associated user. Here''s part of the comment class (which was originally defined in the plugin, but I moved it to the models folder, a move which seems not to affect the
2007 Oct 04
4
2 more JSON / XML feature parity patches before Rails 2.0
I''d really like to see just 2 more functional changes to the JSON serialization/encoding before we get to Rails 2.0. First, and I think this is really crucial because without it all the efforts to output JSON from ActiveRecord objects would have been half in vain, is to allow us to do this in controllers: @authors = Author.find(:all) render :json => @authors.to_json(:only =>
2012 Jan 25
4
serializable_hash and serializable_add_includes
I''m trying to write a helper method similar to attr_accessible but instead it will be used to whitelist which attributes are available for serialization (attr_serializable). My first attempt at this was to override serialized_hash and modify the :only option to include nothing but serializable attributes. I''m facing a problem when nested models are ''included''
2007 Mar 28
7
Rails, REST and JSON
Hi everyone, I''m writing a lightweight AJAX application using Rails on the server side as a RESTful web service provider. I need the web service to support both JSON and XML I/O. Outputting data in XML and JSON is easy (using to_xml and to_json), and it''s also easy to do XML input as Rails does it for you automatically. Is it possible to somehow have the same automatic parsing
2007 Dec 27
5
Rails 2.02 dropped JSON attribute tag ?
Hey there I was scratching my head over why my application breaks when I run on a local server but works on my remote server. It turns out that my local server is Rails 2.0.2 and my remote server is 1.2.3 and I expect the tag "attributes" to be passed with a json stream, before parsing. Unfortunately, this was dropped in 2.0.2. Is there any documentation on this? Any way to get it back?
2006 Feb 10
7
convert rails object to javascript variables
Am i a total idiot to try and parse out a rails object for javascript in this way? <% for i in interface_items[0].attributes %> var <%= i[0] %> = "<%=h( i[1] )%>" <% end %> Am I missing something really obvious? Thanks, Mark -- -------------------------------------------------------------------- I am Mark Daggett and I approve this message.
2019 Nov 28
2
ESEARCH is announced but it doesn't work
I am using Dovecot 2.3.4. I could upgrade if necessary. I see this capabilities after login in: """ a OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN
2010 Apr 05
2
Harmonizing JSON/XML serialization
The way Rails handles root nodes in JSON and XML serialization is inconsistent. This has been discussed before: https://rails.lighthouseapp.com/projects/8994/tickets/2584-232-activeresource-json-doesnt-send-parameters-with-root-node This seems mostly taken care of with ActiveModel::Base.include_root_in_json, especially if/when it ends up in ActiveResource. However, there is also the issue of how