只有当用户在posts_edit_path中时我才需要显示文本,我该怎么做?
谢谢!
我的帖子形成了我想向 post_edit_path 中的用户显示此文本的位置
<%= nested_form_for(@post) do |f| %>
<% if @post.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
<ul>
<% @post.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
</div>
<% end %>
<div id="field">
<%= f.label :Nosaukums %>:<br /><br />
<%= f.text_field :title %><br /><br />
</div>
<div id="field">
<%= f.label :Raksts %>:<br /><br />
<%= f.text_area :content %><br /><br />
</div>
<div id="field_browse">
<b><%= f.label :Bildes %>:</b><br />
Lai izdzēstu bildes, ieklikšķiniet tās un publicējiet rakstu.<br /><br />
<%= f.fields_for :assets do |asset| %>
<% if asset.object.new_record? %>
<div style="clear: both;"></div>
<%= asset.file_field :image %>
<%= f.link_to_remove "Noņemt" %>
<% end %>
<% unless asset.object.new_record? %>
<p>
<div id="pictures_in_form"><%= link_to image_tag(asset.object.image.url(:thumb)), asset.object.image.url(:big), :class => "fancybox", :rel => "gallery" if asset.object.image? %></div>
<div id="delete_box"><%= asset.check_box :_destroy if asset.object.image?%></div>
</p>
<% end %>
<% end %>
<%= f.link_to_add "Pievienot bildes", :assets %>
</div>
<div style="margin-top: 15px;">
<%= f.submit "Publicēt rakstu", :id => "button-link" %>
</div>
<% end %>