app/controllers/spud/admin/pages_controller.rb in spud_cms-0.4.8 vs app/controllers/spud/admin/pages_controller.rb in spud_cms-0.7.0

- old
+ new

@@ -38,11 +38,11 @@ @templates = SpudTemplate.all @page = SpudPage.new Spud::Cms.default_page_parts.each do |part| - @page.spud_page_partials.new(:name => part) + @page.spud_page_partials.new(:name => part.strip) end respond_with @page end def create @@ -56,17 +56,17 @@ add_breadcrumb "Edit", :edit_spud_admin_page_path @templates = SpudTemplate.all if @page.spud_page_partials.blank? Spud::Cms.default_page_parts.each do |part| - @page.spud_page_partials.new(:name => part) + @page.spud_page_partials.new(:name => part.strip) end end if !@page.spud_template.blank? @page.spud_template.page_parts.split(",").each do |part| - partial = @page.spud_page_partials.select{|p| p.name == part} + partial = @page.spud_page_partials.select{|p| p.name == part.strip} if partial.blank? - @page.spud_page_partials.new(:name => part) + @page.spud_page_partials.new(:name => part.strip) end end end end