Updated Import data with page data importing successfully

This commit is contained in:
saurabhbhatia 2013-09-14 12:58:20 +08:00
parent a93945cd45
commit 50bb2a870c
1 changed files with 7 additions and 7 deletions

View File

@ -252,8 +252,8 @@ class Admin::ImportDataController < OrbitBackendController
} }
end end
@i = 0
if @pages.present? if @pages.present?
@i=0
@pages.each do |b| @pages.each do |b|
get_variables_for_new get_variables_for_new
@ -266,20 +266,20 @@ class Admin::ImportDataController < OrbitBackendController
@page.enabled_for= ["en", "zh_tw", ""] @page.enabled_for= ["en", "zh_tw", ""]
@page.is_published = false @page.is_published = false
if b[:menu_title].blank? if b[:menu_title].blank?
@page.title = "No Title Present" @page.title = 'No Title Present'
@page.name = "No Name Present" @i += 1
@page.name = "#{@i}Page"
else else
@i += 1
@page.title = b[:menu_title] @page.title = b[:menu_title]
@page.name = b[:menu_title] @page.name = "#{@i}Page"
end end
if b[:content].blank? if b[:content].blank?
@page.content = "No Content Present" @page.content = "No Content Present"
else else
@page.content = b[:content] @page.content = b[:content]
end end
@i += 1 @page.save!
Rails.logger.info"@@@@@@@@@@@@@@@@@@@@@@@@"+@i.inspect
@page.save
end end
else else
puts "No Page Data" puts "No Page Data"