similar to: to_xml and underscores

Displaying 20 results from an estimated 300 matches similar to: "to_xml and underscores"

2006 Jun 13
1
reloading modules
hi, can anybody tell me how i can reload modules automatically that are living in my ../lib directory? for the moment i need to shut down rails and restart to see any changes. thanks ciao robertj -- Posted via http://www.ruby-forum.com/.
2006 Jul 31
2
is it possible to make to_xml use underscore instead of dash?
Hi all, I am getting ActiveRecord to produce XML with render :xml => @user.to_xml However, on the client end it is a bit annoying for me to deal with attributes like first-name. I would much rather have first_name. Is there any way for me to turn off the behavior of converting _ to -? This seems to be done by a call to dasherize inside the to_xml of
2008 Nov 10
3
to_xml and helper methods
Hi, I have an array with objects and I want to generate an XML like: <objects> <object> <category_id>1</category_id> <helper-method>result 1</helper-method> </object> <object> <category_id>2</category_id> <helper-method>result 2</helper-method> </object> </objects> The helper
2009 Jan 09
2
Confused about to_xml() in ActiveRecord::Base subclass
Since all my efforts to control how to_xml() is formatting dates has failed, I''m now considering writing my own to_xml(). However, from the limited examples I''ve found, I just don''t understand how to actually reference the columns for the records in my record set. Here''s a simplified view of my ActiveRecord object: class Errors < ActiveRecord::Base
2007 Sep 30
1
to_xml node names with underscores
When I call to_xml on my active record objects, it replaces underscores with hypens. E.g.: <categories> <category> <content-provider-id type="integer">1</content-provider-id> <id type="integer">2</id> <name>Traffic Alerts</name> </category> </categories> When the actual field is content_provider_id. I remember
2009 Jan 21
1
AR to_xml problem with associations, Builder::XmlMarkup#to_a
When I do a to_xml(with a block) on an association of a model I got a Builder::XmlMarkup#to_ary should return Array Example that does not work. @intervenant = Intervenant.find(params[:id]) output = @intervenant.to_xml( :skip_types => false, :dasherize => false) do |xml| @intervenant.individu.to_xml( :builder => xml, :skip_instruct => true, :skip_types => false,
2006 Jun 20
3
How to get hold of a patch
I have been researching a problem and found that ticket 4989 solves my problem (to_xml has new dasherize option). I am new to RoR and was wondering if the patch that has been mentioned is available for public release. If so where can I find it and how to apply? Thank you Andrew -- Posted via http://www.ruby-forum.com/.
2011 Jun 20
5
Helper methods in coffescript files
Hi, I was wondering if there is a way to make helper methods available in my .coffe files, Im trying to generate a graph from some userdata with a javascript library, and with the new asset pipeline I can append .erb so its users.js.coffe.erb which works just great, but I need some way to get the current_user helper method.. help ? -- You received this message because you are subscribed to the
2004 Jul 14
5
ACD Issues
Alright, folks. I just deployed * into full production at my office. We have around 50 7905's, 5 7940's, and a handful of soft clients. We run a call center with around 15 agents. I also have a queue set up for the receptionists so that they don't get bombarded with calls. Everything seems to be working with a very few minor glitches. I firmly believe that the few problems we are
2007 Jun 11
2
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by default? I know I can use tag!, but I''d like to find a way for it to translate underscores to dashes automatically. In other words: xml.department_manager do "fred end #=> <department-manager>fred</department-manager> I tried hacking Builder::XmlBase.method_missing but got myself all twisted up!
2009 Apr 18
1
RESTful posting
I''m implementing a Rails front end to a Windows system by using RESTful web services to send data back and forth. Luckyly all the business objects in the Windows system know how to serialize themselves into XML so it''s not too complicated. But when I looked at the XML that gets sent back to the service in a POST when you do a myresource.save, all the fields that had underscores
2008 Apr 22
0
Overriding to_xml() - Why Does This Work?
In Chapter 5 of his book, Flexible Rails, Peter Armstrong''s leads his readers through an exercise to override the behavior of to_xml() in ActiveRecord objects so that :dasherize would be false by default. I found his solution inelegant. I came up with a more elegant one, and it seems to work. All I did was add the following to the very end of myapp/config/ environment.rb: class
2007 Feb 21
1
Rendering all the elements when calling Array#to_xml
When I call to_xml on an array, I want it to get the XML for all the elements in it. I''ve defined to_xml in my class. >> r.to_xml => "<video><id>1</id><views>2</views></video>" >> a = [r] => [#<StatisticsReport:0x3259f38 @video_id=1, @views=2>] >> a.to_xml => "<?xml version=\"1.0\"
2007 Feb 15
3
Restrict attributes in to_xml
For example, let''s say I have a User model with 2 attributes: 1. pw_hash 2. pw_salt I don''t want these to show up in the to_xml method. How do I keep to_xml from using these attributes? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Jun 19
6
to_xml depth ...
hello, The "render :xml => myFriends.to_xml", return something like: <people> <person> <id type="integer">2</id> ... <person> But a Person has a "has_many" relationship and they are not in the xml, => so is it possible to change the depth of the marshall process ? if it not possible, what are the "rails
2010 Feb 11
2
Inconsistent Hash#to_xml Method
I have a unit test that demonstrates some inconsistent behavior with a Hash being converted to XML with the :root option. Sometimes it works fine: Hash.new.to_xml(:root => ''test'') "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<test>\n</test>\n" But sometimes I get an argument error: Hash.new.to_xml(:root =>
2005 Jan 18
1
QoS tagging - can Asterisk do this, if not, what do you recommend?
> -----Original Message----- > From: Dale [mailto:dale-list@lightwavetech.com] > Sent: Tuesday, January 18, 2005 1:45 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: [Asterisk-Users] QoS tagging - can Asterisk do this, > if not,what do you recommend? > > So my question is, does Asterisk offer the > ability to mark the voice data with the
2004 Apr 02
1
X-Lite -> Asterisk: Cannot transmit Audio
I am just an Asterisk newbie doing a test install. I am using 2 X-Lite clients and have configured them according to the wiki on voip-info. A warning is still displayed on the Asterisk server console saying that I should disable RFC3389 on the client, even after I changed the Transmit Silence to yes. I am able to connect and call the other client, but when I do no audio is being transmitted by
2007 Nov 20
2
Anyone using to_xml and procs...
I''m looking for comments on http://dev.rubyonrails.org/ticket/10162 In my opinion, the current behaviour is a bug, and should be fixed. If you have a use case where passing procs to the child associations is actually useful, chime in. Jonathan del Strother --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2007 Dec 12
2
to_xml ignore fields
Hi! I''d like to know how to (most easily) ignore some elements from produced XML .. for example: @people.to_xml produces: <person> <id>2</id> <name>bob</name> <street>carson street</street> </person> ... How can I *not* produce the "ID" field for example? Thank you! -- Posted via http://www.ruby-forum.com/.