app/views/posts/_form.html.erb in devape_cms-0.1.6 vs app/views/posts/_form.html.erb in devape_cms-0.1.7
- old
+ new
@@ -1,30 +1,10 @@
-
-<% content_for :javascript do %>
-<script type="text/javascript" src="/javascripts/tiny_mce/tiny_mce.js"></script>
-<script type="text/javascript">
-tinyMCE.init({
- mode : "textareas",
- theme : "simple"
-});
-</script>
-<script>
- $(function() {
- $("#tabs").tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
- $("#tabs li").removeClass('ui-corner-top').addClass('ui-corner-left');
- });
-</script>
-
-
-
-<% end %>
-
+<%= render 'js' %>
<%= 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>
@@ -34,11 +14,17 @@
<div class="field">
<%= f.label :title %><br />
<%= f.text_field :title %>
</div>
<div class="field">
- <%= f.label :contents %><br />
+ <%= f.fields_for :contents do |builder| %>
+ <%= render "content_fields", :f => builder %>
+ <% end %>
+ <p><%= link_to_add_contents "Add Content", f, :contents %></p>
+
+ <%#= f.label :contents %><br />
+ <!--
<div id="tabs">
<ul>
<li class="rounded-nav aa"><a href="#tabs-1">One</a></li>
<li class="rounded-nav ab"><a href="#tabs-2">Two</a></li>
</ul>
@@ -47,9 +33,10 @@
</div>
<div id="tabs-2">
<textarea style="height:400px; width:800px;" name="contents[two]"><% if (@post.contents.second) then %><%= raw @post.contents.second.content %><% end %></textarea>
</div>
</div>
+ -->
<div class="toggle">
<div class="field">
<%= f.label :template %>
<%= f.text_field :template %>
</div>