You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
class StatementDocumentData < Mustache
def initialize(statement)
@statement = statement
end
def invoices
@statement.invoices.map do |invoice|
data = InvoiceDocumentData.new(invoice)
data[:additional_information] = "Something extra"
data
end
end
end
Where InvoiceDocumentData follows a similar structure (some methods to define data available to a mustache template). The idea here is that the same view data can be used from within the statements' invoice loop, or from within an individual statement template itself (We use different mustache views depending on the situation)... However, I'm noticing that no matter how I structure it, the dict-style addition :additional_information doesn't seem to be available to the template, and it just renders empty.
All of the method-defined values in InvoiceDocumentData are working correctly.
Any idea why the dict-style definition isn't working here? Or what I can do to work around it? I tried setting values on data.context and/or returning the context instead of the View itself but nothing seems to do quite what I had in mind.
The text was updated successfully, but these errors were encountered:
So my mustache view looks something like this:
Where
InvoiceDocumentData
follows a similar structure (some methods to define data available to a mustache template). The idea here is that the same view data can be used from within the statements' invoice loop, or from within an individual statement template itself (We use different mustache views depending on the situation)... However, I'm noticing that no matter how I structure it, the dict-style addition:additional_information
doesn't seem to be available to the template, and it just renders empty.All of the method-defined values in
InvoiceDocumentData
are working correctly.Any idea why the dict-style definition isn't working here? Or what I can do to work around it? I tried setting values on
data.context
and/or returning the context instead of the View itself but nothing seems to do quite what I had in mind.The text was updated successfully, but these errors were encountered: