我试图制作一个部分形式。但是出现了这样的错误:
SyntaxError in Vorlesungs#new
Showing /home/babak/Management/app/views/vorlesungs/_Form.erb where line #1 raised:
compile error
/home/babak/Management/app/views/vorlesungs/_Form.erb:1: dynamic constant assignment
..._assigns[:submit_lable];Form = local_assigns[:Form];;@output...
^
Extracted source (around line #1):
1: <html>
2: <body>
3: <p>
4: <table>
这是我的_Form代码:
<html>
<body>
<p>
<table>
<tr align="center" style="width: 100%">
<td width="25%"></td>
<td width="50%">
<table>
<tr>
<td>Name : </td>
<td><%= v.text_field :Name %> </td>
</tr>
<tr>
<td>Name de Professur :</td>
<td><%= v.text_field :Leiter_name %></td>
</tr>
<tr>
<td>Proffesuren :</td>
<td><%= v.text_field :Professuren %></td>
</tr>
<tr>
<td> <%= submit_tag submit_lable%></td>
</tr>
</table>
</td>
<td width="25%"></td>
</tr>
</table>
</p>
</body>
</html>
在我看来:
<%= form_for(@vorlesung) do |v| %>
<%= render :partial => 'Form',:locals => {:v =>v,:submit_lable =>'Update'} %>
<% end %>
感谢您的帮助
答案 0 :(得分:2)
将您的部分名称设为小写。