Noah Clark
Noah Clark

Reputation: 8131

Issue with Form Not Posting Using Nginx, Ruby, HAML and Sinatra

Here is my code in my ask.haml file:

 %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"}

And, when I run this on my local machine using either shotgun or just plain ruby and run the main .rb file it rends like such:

<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> 

But, when I upload it to my server (webfaction) and restart nginx even, I get this:

<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> 

The post and which page to direct it to are missing. Any ideas on how to even get started trouble shooting this? Thanks in advance.

UPDATE: As I've dug into this a bit more, it looks like nginx is loading an older file called ask.haml. I've confirmed the newer file is on the server.

Upvotes: 0

Views: 434

Answers (1)

David Grandinetti
David Grandinetti

Reputation: 640

Sounds like you may have the html cached in your browser. Try opening a different browser (or explicitly emptying your browser cacche) and aiming it at your production app.

Upvotes: 1

Related Questions