On Tue, Sep 15, 2009 at 10:18 AM, Norman Clarke <[email protected]> wrote: > On Tue, Sep 15, 2009 at 5:07 AM, Gimi <[email protected]> wrote: >> >> I was using Sinatra 0.9.4 + haml 2.2.4. >> >> I defined a variable in a get method, like: >> get '/' do >> �...@msg = "New message" >> end >> >> And I wanted to retrieve it on my haml template through Interpolation, >> like: >> %p You've got #...@msg} >> >> But it turned out that @msg is nil! Why? Am I missing anything? >> >> Any body can give me a tip? Any help is greatly appreciated! > > Try: > > %p= "You've got #...@msg}" > > Unless you use the "=" operator then the text after the %p is > evaluated as plain content, not code.
Actually, I'm wrong. Haml *should* be interpolating your variable there. Sorry, but I'm not entirely sure what the issue might be; the code you posted looks fine. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Haml" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/haml?hl=en -~----------~----~----~----~------~----~------~--~---
