Guys,
I've read the NKS cover to cover, but think I might be misunderstanding scope.
For example, in the lastest (git pull; rake) version of shoes, this code:
#############################
class MyApp < Shoes
url "/", :index
url "/next", :next
def index
@x = edit_line
para(link("next", :click=>"/next"))
end
def next
begin
alert (@x.text)
rescue Exception=>e
puts e
end
end
end
Shoes::app
#############################
Outputs "undefined method `text' for nil:NilClass" on the console. So
@x is nil. However, if I read NKS correctly, especially page 36, @x
should still exist and the text should be accessible.
Can anyone explain why this is happening?
Thanks,
John