Update text_marquees_controller.rb
fix error create title for img tag
This commit is contained in:
parent
1b9914dcf8
commit
ea315a7f89
|
@ -4,11 +4,7 @@ class TextMarqueesController < ApplicationController
|
|||
marquee = Marquee.find(OrbitHelper.widget_custom_value)
|
||||
texts = marquee.marquee_texts.collect do |mqt|
|
||||
doc = Nokogiri::HTML(mqt.title)
|
||||
if mqt.title.to_s.empty?
|
||||
title = 'no content'
|
||||
else
|
||||
title = doc.css('span').text.empty? ? mqt.title : doc.css('span').text
|
||||
end
|
||||
title = doc.text.empty? ? 'no content' : doc.text
|
||||
{
|
||||
"text" => mqt.title,
|
||||
"speed" => mqt.speed,
|
||||
|
|
Loading…
Reference in New Issue