0

I have xml and want add ruby code in it.

When have done <Date><%= params[:date] %></Date> it works ok

but when i need

<PTC Quantity=<%= params[:travellers]['ADT']%> >ADT</PTC>

after it i have got syntax error

original xml for PTC <PTC Quantity="1">ADT</PTC>

How to add ruby code to nested xml values?

3
  • 2
    can you please post the error Commented Dec 5, 2016 at 11:52
  • 1
    <PTC Quantity="<%= params[:travellers]['ADT'] %>" >ADT</PTC> - does this work ? Commented Dec 5, 2016 at 11:53
  • " double quotes " works Commented Dec 5, 2016 at 12:04

1 Answer 1

2

You need to embed your ruby code inside quotes:

<PTC Quantity=" <%= params[:travellers]['ADT'] %> ">ADT</PTC>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.