首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >Camping是在问号处拆分URL

Camping是在问号处拆分URL
EN

Stack Overflow用户
提问于 2013-02-17 10:44:13
回答 1查看 231关注 0票数 0

这就是我的问题:

Camping正在用问号拆分urls。

所以如果我们有一些这样的代码:

代码语言:javascript
复制
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

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/14917468

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档