Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 迈克尔·哈特尔-第2章_Ruby On Rails_Ruby - Fatal编程技术网

Ruby on rails 迈克尔·哈特尔-第2章

Ruby on rails 迈克尔·哈特尔-第2章,ruby-on-rails,ruby,Ruby On Rails,Ruby,我已经阅读了第二章,进展很顺利,只是他要求读者先向用户展示micropost,这似乎很简单。你可以看到这一章 在我的show.html.erb中,我添加了以下几行: <p id="notice"><%= notice %></p> <p> <strong>Name:</strong> <%= @user.name %> </p> <p> <strong>Emai

我已经阅读了第二章,进展很顺利,只是他要求读者先向用户展示micropost,这似乎很简单。你可以看到这一章

在我的
show.html.erb
中,我添加了以下几行:

<p id="notice"><%= notice %></p>

<p>
  <strong>Name:</strong>
  <%= @user.name %>
</p>

<p>
  <strong>Email:</strong>
  <%= @user.email %>
</p

<p>
  <strong>Post:</strong>
  <%= @user.microposts.first %>
</p>

<%= link_to 'Edit', edi<p id="notice"><%= notice %></p>

名称:

电子邮件:
返回单个post对象。要呈现内容,请执行此操作

返回单个post对象。要呈现内容,请执行此操作


嗯,这很简单。谢谢。或者你可以将
改写为_
,这样帖子的表示就是它的内容。好吧,那很简单。谢谢。或者你可以将
改写为_
,这样文章的表示就是它的内容。