[英]Ruby on Rails : How to see information in render form?
I am learning Ruby On Rails.I'd like to understand how RoR works. 我正在学习Ruby On Rails,我想了解RoR的工作原理。 I have the following url when i want to edit user informations:
当我要编辑用户信息时,我有以下URL:
http://localhost:3000/users/3/edit
Here is my controller : 这是我的控制器:
# GET /users/1/edit
def edit
end
The form is : 形式是:
<div class="ui middle aligned center aligned grid">
<div class="column">
<h1>Profil</h1>
<div class="ui form segment">
<%= render "form" %>
</div>
</div>
</div>
<%= link_to 'Show', @user %> |
<%= link_to 'Back', users_path %>
I understand that the form is print by the code <%= render "form" %>
. 我知道表单是通过代码
<%= render "form" %>
打印的。 I'd like to know how to see what contains form ? 我想知道如何查看包含的表格? Which informations are available in form ?
哪些信息以表格形式提供?
The render
method is used to load a partial. render
方法用于加载部分。 A partial is basically repeated fragment of code in a view. 视图中的部分代码基本上是重复的片段。 To keep things dry, you separate it out in a partial and then pass it to the
render
method to render
it. 为了保持干燥,可以将其分成一部分,然后将其传递给
render
方法进行render
。
In your case, the form
is a partial. 在您的情况下,
form
是局部的。
You will most probably find it at app/views/users/_form.html.erb
您很可能会在
app/views/users/_form.html.erb
找到它
Partials are always prefixed with a _
in their filename. 部分名称的文件名始终以
_
开头。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.