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)
|
marquee = Marquee.find(OrbitHelper.widget_custom_value)
|
||||||
texts = marquee.marquee_texts.collect do |mqt|
|
texts = marquee.marquee_texts.collect do |mqt|
|
||||||
doc = Nokogiri::HTML(mqt.title)
|
doc = Nokogiri::HTML(mqt.title)
|
||||||
if mqt.title.to_s.empty?
|
title = doc.text.empty? ? 'no content' : doc.text
|
||||||
title = 'no content'
|
|
||||||
else
|
|
||||||
title = doc.css('span').text.empty? ? mqt.title : doc.css('span').text
|
|
||||||
end
|
|
||||||
{
|
{
|
||||||
"text" => mqt.title,
|
"text" => mqt.title,
|
||||||
"speed" => mqt.speed,
|
"speed" => mqt.speed,
|
||||||
|
|
Loading…
Reference in New Issue