index.rb in the sinatra example

8 views
Skip to first unread message

Bert Fitié

unread,
Dec 6, 2009, 9:40:02 AM12/6/09
to Mustache
I think there is a small error in the index.rb of the sinatra example.
I didn't get <h1>Mustache + Sinatra = Wonder</h1> in the home page.

After changing

class App
module Views
class Index < Mustache
def content
"Welcome! Mustache lives."
end
end
end
end

into

class App
module Views
class Index < Mustache
def title
@title
end
def content
"Welcome! Mustache lives."
end
end
end
end

I got the <h1>Mustache + Sinatra = Wonder</h1> in the home page

-- Bert

Chris Wanstrath

unread,
Dec 7, 2009, 12:42:56 PM12/7/09
to musta...@googlegroups.com
On Sun, Dec 6, 2009 at 6:40 AM, Bert Fitié <be...@analytag.com> wrote:

> I think there is a small error in the index.rb of the sinatra example.
> I didn't get <h1>Mustache + Sinatra = Wonder</h1> in the home page.

Nice catch! I've updated the example so that Index inherits from
Layout and the page renders as intended.

--
Chris Wanstrath
http://github.com/defunkt
Reply all
Reply to author
Forward
0 new messages