Sha256: fec0fbb77aaf2c6731783db0ee904b815121a8043e3d47f3f238c3640777d482
Contents?: true
Size: 1.51 KB
Versions: 2
Compression:
Stored size: 1.51 KB
Contents
<%= wiki_page_style %> <h1><%=wt 'Editing wiki page' %></h1> <% if params[:preview] %> <div class="wiki_content"> <%=wiki_content @page.content %> </div> <% end %> <%= wiki_page_form do |f| %> <%= f.hidden_field :previous_version_number, :value => f.object.last_version_number %> <%= hidden_field_tag :path, @page.path %> <p><%=wt 'Title:' %><br /><%= f.text_field :title %></p> <%# If our 'content' contains newlines, Erubis will indent them (to make the produced HTML look nicer). However those indenting spaces *will* appear in the textarea in the user's browser and will get POSTed by the browser when submitting the form and thus would get written to the wiki content into the database. The gsub's below replace the linebreaks ('\r\n') with UTF8 linefeeds (same way HAML solves this problem), which are ignored by Erubis and should be correctly displayed as linebreaks by modern browsers. %> <p><%=wt 'Content:' %><br /> <%= f.text_area(:content, :value => f.object.content.gsub("\n", '
').gsub("\r",''), :class => 'ckeditor').html_safe %></p> <p><%=wt 'Comment on this change (optional):' %><br /><%= f.text_field :comment %></p> <input type="submit" name="save" value="<%=wt 'Save page' %>" class="submit" /> <input type="submit" name="preview" value="<%=wt 'Preview' %>" class="submit" /> <input type="submit" name="cancel" value="<%=wt 'Cancel' %>" class="submit" /> <% end %> <%= wiki_page_attachments(@page) %>
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
irwi_mod-0.0.2 | app/views/base_wiki_pages/edit.html.erb |
irwi_mod-0.0.1 | app/views/base_wiki_pages/edit.html.erb |