shoes4
shoes4 copied to clipboard
Allow passing data to url from visist
Currently it is possible to define a url with a variable segment like so:
url '/{foo}', :foo
This will call the method foo with whatever is part of the url, eg
visit '/bar'
will call foo with argument bar.
This is very limiting, as we can only pass around string arguments. It would be nice to be able to pass around a hash, like so
visit '/bar', number: 42
def foo(bar, data)
a = data[:number]
end
Hi there,
thank you for your suggestion. I like it! :)
I set it to the 4.1 mile stone as it is not part of the shoes3 DSL and shoes3 compatibility is the main goal for 4.0. However, feel free to send a PR we'll merge it either way. As it's easy to do, once I got more time I might also implement it :)
Cheers and thanks! Tobi