text_marquee/app/controllers/text_marquees_controller.rb

21 lines
409 B
Ruby

class TextMarqueesController < ApplicationController
def widget
subpart = OrbitHelper.get_current_widget
marquee = Marquee.find(OrbitHelper.widget_custom_value)
texts = marquee.marquee_texts.collect do |mqt|
{
"text" => mqt.title,
"speed" => mqt.speed,
"url" => (mqt.url || "")
}
end
{
"texts" => texts,
"extras" => {
"subpart-id" => subpart.id.to_s
}
}
end
end