Sha256: ebdf7474857cd946e5b24dec8828c2103e827f5eb2dc9688035b55e272394ec5

Contents?: true

Size: 1.2 KB

Versions: 6

Compression:

Stored size: 1.2 KB

Contents

%ul.ask.questions
  =f.fields_for(:questions) do |question|
    %li.question
      %dl
        .hidden.position-wrapper
          =question.hidden_field(:position)
        %dt.name=question.label(:name)
        %dd.name=question.text_field(:name, :placeholder=>'Title')
        %dt.instructions=question.label(:instructions)
        %dd.instructions=question.text_area(:instructions, :placeholder=>'Instructions')
        %dt.type=question.label(:type)
        %dd.type=question.collection_select(:type, Question::TYPES, :to_s, :titleize)
        %dt.required=question.label(:required)
        %dd.required=question.select(:required, [['Optional', false], ['Required', true]])
        -unless question.object.new_record?
          %dt.delete=question.label(:_destroy, 'Delete')
          %dd.delete=question.check_box(:_destroy)
        %dt.choices
        %dd.choices
          %ul.choices
            =question.fields_for(:choices) do |choice|
              %li.choice
                =choice.label(:name)
                =choice.text_field(:name, :placeholder=>'Choice')
                -unless choice.object.new_record?
                  =choice.label(:_destroy, 'Remove')
                  =choice.check_box(:_destroy)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ask-0.3.1 app/views/asker/_form.html.haml
ask-0.3.0 app/views/asker/_form.html.haml
ask-0.2.0 app/views/asker/_form.html.haml
ask-0.1.2 app/views/asker/_form.html.haml
ask-0.1.1 app/views/asker/_form.html.haml
ask-0.1.0 app/views/asker/_form.html.haml