ruby on rails - If current page posts_edit_path then show a text -



ruby on rails - If current page posts_edit_path then show a text -

i need show text if user in posts_edit_path, how can this?

thank you!

my posts form want show text (lai izdzēstu bildes, ieklikšķiniet tās united nations publicējiet rakstu.) users in posts_edit_path

<%= nested_form_for(@post) |f| %> <% if @post.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@post.errors.count, "error") %> prohibited post beingness saved:</h2> <ul> <% @post.errors.full_messages.each |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 united nations publicējiet rakstu.<br /><br /> <%= f.fields_for :assets |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 %>

you can this:

<div id="field_browse"> <b><%= f.label :bildes %>:</b><br /> <%= "lai izdzēstu bildes, ieklikšķiniet tās united nations publicējiet rakstu." if action_name.eql? "edit" %> <br /><br /> <%= f.fields_for :assets |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 %>

ruby-on-rails ruby

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -