mustache 0.9 and sinatra 1.0 issue

20 views
Skip to first unread message

Matt

unread,
Mar 26, 2010, 8:25:08 PM3/26/10
to Mustache
I just upgraded an app to sinatra 1.0 and mustache 0.9 ...

I was using instance variables in sinatra actions to pass data into
mustache views...

as in:

get "/post/:id" do
@post_id = id
end

I was also using a before filter to pass in the session:

before do
@session = session
end

After the upgrade it seems that my mustache helpers are no longer able
to see these ivars. I'm trying to figure out the best way to handle
this... Maybe locals?

Any advice would be much appreciated.

Chris Wanstrath

unread,
Mar 26, 2010, 11:01:22 PM3/26/10
to musta...@googlegroups.com

Can you share your helpers or explain your setup a bit more? I've
created a test app in which ivars are passed to View classes
successfully:

https://gist.github.com/5304ecaf565147c7e488

--
Chris Wanstrath
http://github.com/defunkt

Reply all
Reply to author
Forward
0 new messages