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

Nokogiri options not passed to Builder #150

Closed
aiwilliams opened this issue Jun 6, 2012 · 1 comment
Closed

Nokogiri options not passed to Builder #150

aiwilliams opened this issue Jun 6, 2012 · 1 comment
Milestone

Comments

@aiwilliams
Copy link

Is there a reason this is the case? I would like to send the :encoding option to the Nokogiri::XML::Builder initializer.

@judofyr
Copy link
Collaborator

judofyr commented May 13, 2013

The reason for this is that the call to Nokogiri::XML::Builder.new is inlined and compiled so there's no easy way to send options there. You can however pass in a local variable called xml and Tilt will use that object:

tmpl = Tilt.new('index.nokogiri')
tmpl.render(Object.new, :xml => Nokogiri::XML::Builder.new(:encoding => ))

@judofyr judofyr closed this as completed May 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants