[英]form not displayed in page source
i am creating a veiw page in my rails application this is my view page : 我正在我的rails应用程序中创建一个veiw页面这是我的查看页面:
<html>
<head>
<%= stylesheet_link_tag "$.multiselect2side", :media => "all" %>
<%= javascript_include_tag "$.multiselect2side" %>
<script>
$().ready(function() {
$("#student_name_id").multiselect2side();
});
</script>
<script>
function callGrade(grade_value_123) {
var id = grade_value_123;
}
</script>>
</head>
<body>
<div class="container">
<h1> <%= @message%> </h1>
<%= select(:grade,:id,@distinct_grade_list,{},:onchange => "callGrade(this.value)")%>
<%= select(:period,:id,@distinct_period_list)%>
<%= select(:student_name,:id,@student_name_list,{},{ :multiple => true, :size => 4 }) %>
<br/>
<%= radio_button_tag(:age, :child,{},:onclick => "callMe(this.id)") %><%= label_tag(:age_child, :" General Curriculum") %>
<%= radio_button_tag(:age, :adult) %><%= label_tag(:age_adult, :"Common Core Standards") %>
<br/>
<div id="farzi" style="border: 3px solid red;margin-top: 20px">
<% form_tag('call_ajax', :method=>'post', :multipart => true) do %>
<p>
Subject:
<br />
<%= text_field_tag "subject" %>
</p>
<p>
Priority:
<br />
<%= select_tag("priority", options_for_select([['Critical', '1'],
['Important', '2'],['Standard','3']], '3')) %>
</p>
<p>
Describe your problem:
<br />
<%= text_area_tag "description", "", :size=>"50x20" %>
</p>
<p>
Add an attachment:
<br />
<%= file_field_tag "attachment" %>
</p>
<p>
<%= submit_tag 'Submit' %>
</p>
<% end %>
</div>
</body>
</html>
now when i execute the page , the page doent display any form , 现在当我执行页面时,页面会显示任何形式,
and when i check the page source , there is no form content inside the div with id= farzi 当我检查页面源时,div中没有id = farzi的表单内容
in the page source from browser it shows 在它显示的浏览器的页面源代码中
<div id="farzi" style="border: 3px solid red;margin-top: 20px">
</div>
any explanation ?? 任何解释?
Replace 更换
<% form_tag('call_ajax', :method=>'post', :multipart => true) do %>
with this 有了这个
<%= form_tag('call_ajax', :method=>'post', :multipart => true) do %>
The <%=
is used to output data from ruby in html.erb. <%=
用于从html.erb中的ruby输出数据。 If you just execute first command, it will return the correct data, but it won't output anything in html. 如果你只是执行第一个命令,它将返回正确的数据,但它不会输出任何html中的内容。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.