Launch a web url on link click - Ruby Shoes 3

82 views Asked by At

How would I go about launching a web url e.g. https://google.com after clicking a link on Ruby shoes 3?

I used the below code to no effect

flow do
###
para link("some text", click: proc {
visit "https://google.com"
})
###
end

And

flow do
###
para link "some text" do visit "https://google.com" end
###
end

Could someone show me how please?

2

There are 2 answers

0
Shurikan117 On BEST ANSWER

Fixed the link using the method provided on this question

flow do
proc = Proc.new {
system("cmd /c start https://google.com")
}
para link("some text", &proc)
end

Any further suggestions before I close this is welcome.

0
Robin van Dijk On

Try this

flow do
  para(link("some text", :click => "https://google.com"))
end