text_marquee/app/controllers/text_marquees_controller.rb

20 lines
375 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,
"url" => mqt.url
}
end
{
"texts" => texts,
"extras" => {
"subpart-id" => subpart.id.to_s
}
}
end
end