在rails中显示.html.erb和html标记

在rails中显示.html.erb和html标记,html,ruby-on-rails,ruby-on-rails-4,Html,Ruby On Rails,Ruby On Rails 4,我在访问posts/show.html.erb时遇到问题 我可以列出index.html.erb上的所有帖子,但当我尝试访问任何 在show.html.erb中没有显示html标记,就像图像一样,它们是不相似的 我的控制器 class PostsController < ApplicationController before_action :postu_belirt, only: [:show, :edit, :update, :destroy] def index @po

我在访问posts/show.html.erb时遇到问题

我可以列出index.html.erb上的所有帖子,但当我尝试访问任何 在show.html.erb中没有显示html标记,就像图像一样,它们是不相似的

我的控制器

class PostsController < ApplicationController
before_action :postu_belirt, only: [:show, :edit, :update, :destroy]

  def index
    @posts = Post.all
  end

  def show

  end


  def new
    @post = Post.new
  end

private

def postu_belirt
    @post = Post.find(params[:id])
end

def post_parametreleri
    params.require(:post).permit(:baslik,:text)
end

end
class PostsController
index.html.erb

<% @posts.each do |post| %>
<%= link_to post.baslik, post, :class => "baslik"%>
<%= post.created_at.strftime("%d %b %y") %>
<%= post.created_at.strftime("%H:%M") %>
<%= raw post.text %>
<%- end %>
<%=  @post.baslik %>
<%=  @post.created_at.strftime("%d %b %y") %>
<%=  @post.created_at.strftime("%H:%M") %>
<%=  link_to 'Duzenle', edit_post_path(@post), :class => "genel" %>
<%=  raw @post.text %>

“baslik”%>
show.html.erb

<% @posts.each do |post| %>
<%= link_to post.baslik, post, :class => "baslik"%>
<%= post.created_at.strftime("%d %b %y") %>
<%= post.created_at.strftime("%H:%M") %>
<%= raw post.text %>
<%- end %>
<%=  @post.baslik %>
<%=  @post.created_at.strftime("%d %b %y") %>
<%=  @post.created_at.strftime("%H:%M") %>
<%=  link_to 'Duzenle', edit_post_path(@post), :class => "genel" %>
<%=  raw @post.text %>

“genel”%>

谢谢。

好吧,这太奇怪了。你是否尝试过用一些文本替换视图的全部内容来检查它是否正在加载?现在我意识到只有图像没有显示,我正在使用standart html标记来记录,比如
你应该使用
图像\u标记
辅助图像:我尝试过
“/>
都不起作用。谢谢,德帕。顺便说一句,如果我像这样放置
“/>
,我可以在index.html.erb上看到