这就是我的问题:
Camping正在用问号拆分urls。
所以如果我们有一些这样的代码:
Camping.goes :CodeLine
module CodeLine::Controllers
class Index
def get
render :index
end
end
class TextEntered < R '/(.*)'
def get(textStringEntered)
"#{textStringEntered}"
end
end
end
module CodeLine::Views
def index
html do
head do
title "Uh Oh"
end
body do
text "Looks like you got to the index"
br
br
form :name => "input" do
input :type => "text", :name => "text"
input :type => "submit", :value => "Submit"
end
end
end
end
end
运行camping path/to/file
在浏览器中访问localhost:3301
并在文本字段中输入一些文本并点击submit后,您应该会看到斜杠后面的所有内容,但是它会在问号处拆分url,并且因为它认为斜杠后面没有任何内容,所以它会将您带到索引。
问:是否可以将input
设置为不使用问号,或者是否可以在问号处不拆分露营?
附录A
测试于
谷歌ChromeFirefoxSafari
https://stackoverflow.com/questions/14917468
复制相似问题