Let me guess, you're trying to do something like this:
class MyClass < Shoes
stack :width => 200 do
subtitle 'People who like ponies'
para 'TheTXI'
para 'Pesto'
para 'Einstein'
end
stack :width => -200 do
subtitle 'People who hate ponies'
para 'Hitler'
para 'Stalin'
para 'Einstein (He was bipolar)'
end
end
Well of course this doesn't work. para
, stack
, subtitle
, and so on are all instance methods, but you're trying to call them as class methods. They have to be inside an instance method, like this:
class MyClass < Shoes
url '/', :pony_list
def pony_list
stack :width => 200 do
subtitle 'People who like ponies'
para 'TheTXI'
para 'Pesto'
para 'Einstein'
end
stack :width => -200 do
subtitle 'People who hate ponies'
para 'Hitler'
para 'Stalin'
para 'Einstein (He was bipolar)'
end
end
end
Shoes.app :width => 400
See how that stuff is in the pony_list
method now? Of course, we have to make an instance call the method. How can we do that? That's why we call the url
method (which, unlike para
and its friends, actually is a class method). It sets the default url to call the pony_list
method. Remember that you have to call Shoes.app after your class definition and you're all set.