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