Sha256: f7c14db7ddb5f5587e10035862e0d35144f7bec70a1c8886c0aa2874608ea45a

Contents?: true

Size: 469 Bytes

Versions: 4

Compression:

Stored size: 469 Bytes

Contents

module Rapidfire
  module ApplicationHelper
    def render_answer_form_helper(answer, form)
      partial = answer.question.type.to_s.split("::").last.downcase
      render partial: "rapidfire/answers/#{partial}", locals: { f: form, answer: answer }
    end

    def checkbox_checked?(answer, option)
      answers_delimiter = Rapidfire.answers_delimiter
      answers = answer.answer_text.to_s.split(answers_delimiter)
      answers.include?(option)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rapidfire-3.1.0 app/helpers/rapidfire/application_helper.rb
rapidfire-3.0.0 app/helpers/rapidfire/application_helper.rb
rapidfire-2.1.0 app/helpers/rapidfire/application_helper.rb
rapidfire-2.0.0 app/helpers/rapidfire/application_helper.rb