表格未发布使用Nginx,Ruby,HAML和Sinatra的问题

时间:2011-09-02 18:42:41

标签: ruby post nginx sinatra haml

这是我的ask.haml文件中的代码:

 %form{:action => "/calendar", :method => "post"}
            .inputRow
              %label How many days in a row do you work?
              %input#on{:name => "on", :tabindex => "1", :title => "Number of days in a row you work", :type => "text", :value => "4", :id=> "on"}/
            .inputRow
              %label How many days in a row are you off?
              %input#off{:name => "off", :tabindex => "2", :title => "Number of days in a row you're off", :type => "text", :value => "3", :id=> "off"}/
            .inputRow
              %label When is the start of your next block off?
              %input#date{:name => "date", :tabindex => "3", :title => "Start of your next block off", :type => "text", :value => "8/31/2011", :id=> "date"}/
            %button#button{:type => "submit"}

而且,当我使用霰弹枪或普通红宝石在我的本地机器上运行它并运行主.rb文件时,它就像这样:

<form action='/calendar' method='post'> 
          <div class='inputRow'> 
            <label>How many days in a row do you work?</label> 
            <input id='on_on' name='on' tabindex='1' title='Number of days in a row you work' type='text' value='4' /> 
          </div> 
          <div class='inputRow'> 
            <label>How many days in a row are you off?</label> 
            <input id='off_off' name='off' tabindex='2' title="Number of days in a row you're off" type='text' value='3' /> 
          </div> 
          <div class='inputRow'> 
            <label>When is the start of your next block off?</label> 
            <input id='date_date' name='date' tabindex='3' title='Start of your next block off' type='text' value='8/31/2011' /> 
          </div> 
          <button id='button' type='submit'></button> 
        </form> 

但是,当我将它上传到我的服务器(webfaction)并重新启动nginx时,我明白了:

<form> 
        <div class="inputRow"><label>How many days in a row do you work?</label><input type="text" name="on" value="" id="on"  tabindex="1" placeholder="4" title="Number of days in a row you work" /></div> 
        <div class="inputRow"><label>How many days in a row are you off?</label><input type="text" name="off" value="" id="off"  tabindex="2" placeholder="3" title="Number of days in a row you're off" /></div> 
        <div class="inputRow"><label>When's the start of your next block off?</label><input type="text" name="on" value="" id="on"  tabindex="3" placeholder="8/31/2011" title="Start of your next block off" /></div> 
        <button type="submit" id="button"></button> 
        </form> 

帖子和指向哪个页面的内容都丢失了。关于如何开始解决这个问题的任何想法?提前谢谢。

更新:由于我已经深入研究了这一点,看起来nginx正在加载一个名为ask.haml的旧文件。我已经确认新文件在服务器上。

1 个答案:

答案 0 :(得分:1)

听起来您可能在浏览器中缓存了html。尝试打开另一个浏览器(或明确清空浏览器cacche)并将其瞄准生产应用程序。