我是 RoR 的新手,我想知道如何根据我的项目使用字段进行谷歌搜索,有人知道我该怎么做吗?
我的 application.html.haml 中有代码:
%form#search
%input
我该如何实施?
我是 RoR 的新手,我想知道如何根据我的项目使用字段进行谷歌搜索,有人知道我该怎么做吗?
我的 application.html.haml 中有代码:
%form#search
%input
我该如何实施?
将action
表单的 of 设置为http://www.google.com/search
、method
toget
并命名您的input
字段q
。类似于以下内容:
%form#search(action="http://www.google.com/search" method="get")
%input(type="text" name="q")
%input(type="submit")
结果将是 google 搜索的正常 URL,并显示结果:
http://www.google.com/search?q=term1+term2