class TextMarqueesController < ApplicationController def widget subpart = OrbitHelper.get_current_widget marquee = Marquee.find(OrbitHelper.widget_custom_value) texts = marquee.marquee_texts.collect do |mqt| doc = Nokogiri::HTML(mqt.title) title = doc.text.empty? ? 'no content' : doc.text { "text" => mqt.title, "speed" => mqt.speed, "url" => (mqt.url || ""), "content" => (mqt.url.to_s.empty? ? "#{mqt.title}" : "#{mqt.title}") } end { "texts" => texts, "extras" => { "subpart-id" => subpart.id.to_s } } end end