Web Images Videos Maps News Shopping Google Mail more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Using HAML to output resources as XML for ActiveResource -- newlines & whitespace
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
doug livesey  
View profile   Translate to Translated (View Original)
 More options 23 June, 12:33
From: doug livesey <biot...@gmail.com>
Date: Tue, 23 Jun 2009 12:33:34 +0100
Local: Tues 23 June 2009 12:33
Subject: Using HAML to output resources as XML for ActiveResource -- newlines & whitespace

Hi -- I'm using HAML to generate some custom xml that I'm then using for
ActiveResource, which is going swimmingly, except that the attributes of the
models I'm getting in the ActiveResource models have whitespace and newlines
in them, like so:

#<ActiveJob:0xb6de35a8 @prefix_options={},
@attributes={"job_number"=>"\n      N0001\n    ", "job_name"=>"\n      Test
DJL\n    ", "id"=>"\n      42\n    "}

Does anyone know of an easy way to get rid of these?
Maybe an option to render, or HAML, or something?
Cheers,
   Doug.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
doug livesey  
View profile   Translate to Translated (View Original)
 More options 23 June, 12:49
From: doug livesey <biot...@gmail.com>
Date: Tue, 23 Jun 2009 12:49:08 +0100
Local: Tues 23 June 2009 12:49
Subject: Re: Using HAML to output resources as XML for ActiveResource -- newlines & whitespace

The quick & dirty solution is to use content_tag in the HAML template when
defining the fields.
   Doug.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google