text_marquee/app/controllers/text_marquees_controller.rb

21 lines
409 B
Ruby
Raw Normal View History

2015-04-30 09:50:09 +00:00
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,
2016-10-24 06:23:35 +00:00
"speed" => mqt.speed,
2015-04-30 12:31:43 +00:00
"url" => (mqt.url || "")
2015-04-30 09:50:09 +00:00
}
end
{
"texts" => texts,
"extras" => {
"subpart-id" => subpart.id.to_s
}
}
end
end