1
我有一個包含Paperclip附件的多部分Rails表單。當我將它發佈在Firefox,Chrome或Safari上時,沒有任何問題。當我在IE中發佈它時,我的最後兩個參數在請求中完全丟失(不是空白)。它們是簡單的文本輸入字段,值非常小。無論是否包含附件,都會出現問題。對於不是多部分並且輸入較少的不同模型,我有類似的形式。它在IE中正常工作。生產日誌中絕不會有例外,但是由於我驗證了這些缺失屬性的存在,因此存在錯誤。IE表單POST params失蹤
有沒有人有什麼建議可能會導致此問題,或知道在IE中調試此方法?
編輯 - 作爲請求的代碼:
模型
class Bar < ActiveRecord::Base
belongs_to :foo
validates_presence_of :name
validates_uniqueness_of :name, :scope => [:foo_id]
validates_numericality_of :first_missing_attribute, :second_missing_attribute, :message => 'must be a number'
has_attached_file :image, :styles => { :original => ["300x300>"], :thumb => ["100x100>"] }
end
HTML渲染
<form accept-charset="UTF-8" action="/myapp/foos/1/bars" class="new_bar" enctype="multipart/form-data" id="new_bar" method="post">
<div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" />
<input name="authenticity_token" type="hidden" value="01h99m2ZuOAApUNvFCmBSOydMd1IvE0yujLCzSP0lDk=" />
</div>
<div class="step">
<div class="step-count">
<img alt="One" src="/images/one.png?1299957833" />
</div>
<div class="step-field">
<p>NAME</p>
<input id="bar_name" name="bar[name]" size="35" type="text" />
</div>
</div>
<div class="step">
<div class="step-count">
<img alt="Two" src="/images/two.png?1299957833" />
</div>
<div class="step-field">
<p>CONTENT</p>
<select id="bar_formatted" name="bar[formatted]"><option value="false">Keep it simple</option><option value="true">Let me add html & css</option></select><br />
<textarea cols="40" id="bar_content" name="bar[content]" rows="20" style="text-align:left;"></textarea>
<div class="file-input">
<p>ADD AN IMAGE</p>
<input id="bar_image" name="bar[image]" type="file" />
</div>
</div>
</div>
<div class="step">
<div class="step-count">
<img alt="Three" src="/images/three.png?1299957833" />
</div>
<div class="step-field">
<input id="search" type="text" onkeypress="return preventEnter(this, event)"/><input id="find-location" type="button" value="Fly To" onClick="buttonClick()"><br />
<form name="bazs" id="bazs" method="get">
<select onChange="flyTo(this.value);" style="max-width:200px; font-size: 12px; color:#003300" name="locator">
<option value="Baz1">Baz1</option>
<option value="Baz2">Baz2</option>
<option value="Baz3">Baz3</option>
</select>
</form>
</div>
</div>
<div class="step">
<div class="step-count">
<img alt="Four" src="/images/four.png?1299957833" />
</div>
<div class="step-field">
<input id="set-bar" type="button" value="Generate" onClick="setBar()">
</div>
</div>
<div class="step">
<div class="step-count">
<img alt="Five" src="/images/five.png?1299957833" />
</div>
<div class="step-field">
<div id="loading">
<img alt="loading" src="/images/loading.gif?1299957833" />
</div>
<div id="inputs">
<div class="input">
<p>FIRST MISSING ATTRIBUTE</p><input id="bar_first_missing_attribute" name="bar[first_missing_attribute]" onBlur="checkValue(this)" onFocus="removeImage(this)" size="30" type="text" />
</div>
<div class="input">
<p>SECOND MISSING ATTRIBUTE</p><input id="bar_second_missing_attribute" name="bar[second_missing_attribute]" onBlur="checkValue(this)" onFocus="removeImage(this)" size="30" type="text" />
</div>
<div class="save">
<img alt="Clear" onClick="submitForm()" src="/images/clear.png?1299957833" />
</div>
</div>
</div>
</div>
</form>
請顯示一些代碼 –
特別感興趣的是您的型號代碼 – fl00r
和表格的HTML代碼 –