Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating XML from object without indentation #53

Open
Shruti-R opened this issue Mar 7, 2016 · 0 comments
Open

Generating XML from object without indentation #53

Shruti-R opened this issue Mar 7, 2016 · 0 comments

Comments

@Shruti-R
Copy link

Shruti-R commented Mar 7, 2016

Hi @Empact,
I want to generate xml from ruby object without indentation('\n'), but I could not find any option.

book = Book.new
book.isbn = "0201710897"
book.title = "The PickAxe"
book.description = "Best Ruby book out there!"
book.author = "David Thomas, Andrew Hunt, Dave Thomas"

doc = Nokogiri::XML::Document.new
doc.root = book.to_xml

Is there a way I can remove indentation as below in ROXML as similar to to_xml in ActiveSupport :
doc.root = book.to_xml(:indent =>0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant