durfdoen-2.0/lib/helpers/quiz.rb
2020-09-14 20:58:52 +02:00

13 lines
289 B
Ruby

require 'json'
require 'nokogiri'
module QuizHelper
def to_partials(items)
my_hash = {}
items.each do |item|
my_hash[(item[:id] || "none")] = (render '/partials/pretty_link.*', :item => item).gsub("\n", '')
end
my_hash.to_json
end
end