Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 更改提交路由的Rails表单__Html_Ruby On Rails - Fatal编程技术网

Html 更改提交路由的Rails表单_

Html 更改提交路由的Rails表单_,html,ruby-on-rails,Html,Ruby On Rails,我的rails应用程序中有一个表单,当用户点击submit时,我想将其发送到一个简单的“谢谢”页面。我已经看到,您可以使用form_for路由到其他操作,但我不知道如何路由到一个简单的HTML页面 这是我的表格 <html> <body style="text-align:center"> <br> <h2> On a scale from 1-10, how likely are you to

我的rails应用程序中有一个表单,当用户点击submit时,我想将其发送到一个简单的“谢谢”页面。我已经看到,您可以使用
form_for
路由到其他操作,但我不知道如何路由到一个简单的HTML页面

这是我的表格

<html>
    <body style="text-align:center">
        <br>
      <h2>
        On a scale from 1-10, how likely are you to recommend this site to a friend or colleague?
      </h2>
      <br>
      <%= form_for @score do |f| %>
        <%= f.hidden_field :site_id %> 
            <%= f.select(:value, (1..10).to_a) %>
            <br>
                <h2>
            Thank you! Would you care to explain why you chose that?
            </h2>
            <br>
            <%= f.text_area :response %>        
        <%= f.submit "Submit" %>
        <% end %>
    </body>

</html>


从1到10分,你向朋友或同事推荐这个网站的可能性有多大?

非常感谢。你能解释一下你为什么选择这个吗?
您可以这样做

<%= form_for @score, url: "/thankyou.html" do |f| %>


来源:

为什么不在保存评论后直接从创建操作重定向?在提交表单后,使用JS简单地显示一个“谢谢”怎么样?那也可能吗?