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
ActionView:Template turning locals Hash into an array #19204
Comments
The locals hash you are looking for is not present at compile time of the template. The decision to render mustache or not must be inlined in the ruby code returned from your handler.
Also mustache seems needs a hash to work on, so you should probably render your template like
and reference the value in your template like so
Also you should be careful with using |
Please don't use the mailing list to ask question. |
Dear @rafaelfranca, I highly respect your many contributions to Rails. However, this was rude. |
Sorry, that was an automatic comment. I'm very happy that the question was answered and I also do agree I could Although I agree I could say a lot of nice words, this issue is still a Anyway, thank you much for looking this issue, and also for the protest, I ♥ On Wed, Mar 18, 2015, 19:46 Raffael Krebs notifications@github.com wrote:
|
Aaaah, thanks for your nice words! ;) |
hello all |
Hello,
I've been trying (with Rails 4.1.9) to register and use a template handler :
and then I've been trying to use it, from an erb view, in particular with a Hash as a template local :
well, guess what, template.locals turns out to be an array with a single element being the string "mustache" - no trace of the rest of the Hash (:mustache => "{'planet':'world'}")
It seems like the locals array was turned into an array of strings (the strings being the hashes key) between the view and my template handler, I have no clue how it happened,
Do you have any idea why ? How should I use my template handler with views variables ?
thanks a lot in advance !
The text was updated successfully, but these errors were encountered: