debug: yay, I get to talk about closures! :)
Here's what I see William:
:click => "/nums/#{line.text}" interpolates #{line.text} into a string for
your click .. when the link gets rendered. It is probably empty at that
point.
button "Visit Printer" do
visit "/nums/#{line.text}"
end
this passes a closure to your button when the button gets rendered, and the
contents of the closure don't get executed (interpolating the string) until
the button gets pushed.
Can you pass a closure to a link too? I think so but I'm too far away from
my reference material to confirm. Anyway, investigate along that line! :)
- - Jesse
On Feb 17, 2008 6:12 PM, William Ramirez <[EMAIL PROTECTED]> wrote:
> I've run into a little bit of strange behavior that I can't quite figure
> out. I'm sure someone will point out something silly I'm doing, but, alas,
> all my google searches appear to have been for naught. I have ordered the
> book via our friends at Lulu, but the copy has not been put into my grubby
> little hands yet.
>
> Should the 'url' be handled differently when using a link as opposed
> visist? The heart of the issue I'm seeing that I receive a 404 error when I
> click this link in my app:
>
> para link("Number Printer", :click => "/nums/#{line.text}")
>
> But when I click on a button that calls visit, it works:
>
> visit "/nums/#{line.text}"
>
>
> The full text of my tiny, useless little program is here:
> http://www.idlegeeks.org/shoes/test.txt Clicking on the "back to index"
> link seems to work fine.
>
> I'm running Shoes Curious on OS X Leopard.
>