簡單的Rails窗體在Modal內部形成。Rails Submit按鈕不能在類上工作
請問工作: <%= submit_tag "New Form", :class => "waves-button-input" %>
威爾不工作:
<%= submit_tag "New Form", :class => "waves-effect waves-green btn-flat waves-button-input" %>
我試圖通過<input>
標籤這樣做,提交標籤,表單提交的POST等。由於某些原因,添加這些類會破壞它。
對於全方面,我國形式:
<div id="projectModal" class="modal">
<div class="modal-content">
<div class="form-group">
<%= form_tag(new_project_path, method: :get) %>
<%= select_tag :project_type, options_for_select(Project.project_types.keys.to_a), :class => 'id_select', :id => 'secret_id' %><br><br><br>
<%#= text_field :client_id, %>
<%= collection_select :project, :client_id, current_user.clients, :id, :name, :prompt => true %>
</div>
</div>
<div class="modal-footer">
<a class="modal-action modal-close waves-effect waves-green btn-flat modal-close">Cancel</a>
<%= submit_tag "New Form", :class => "waves-button-input" %>
<!--<input type="submit" name="commit" value="New Form" class="waves-effect waves-green btn-flat waves-button-input" data-disable-with="New Form">-->
<!--<input type="submit" name="commit" value="New Form" class="waves-button-input" data-disable-with="New Form">-->
</div>
</div>
在點擊它的作用是改變<i>
顏色和充分發揮作用,但使0的努力來發送數據。通常我會想渦輪增壓或什麼的,但因爲它沒有我感到困惑的程式化。
讓我們看看你用的是什麼js的這一點。你確定它必須是submit_tag嗎? – kolas
@kolas其實它是一個物化模式 - 所以我所擁有的就是model.init() - 它可以使用'submit_tag'或'input_type' - 只要這些類不在那裏。 – DNorthrup