Got this in my view
<% elsif ["radio", "checkbox"].include?(part_child.display_type) %>
<%= tick_tag_slice part_child%>
<% end %>
calling tic_tag_slice
from the helper.
below is my helper of the same
def tick_tag_slice(part_child)
render_type = part_child.display_type == "radio" ? "radio_button_tag" : "check_box_tag"
html = ""
part_child_option = parts_position(part_child.options)
part_child_option. each_slice(6) do |o|
html += "<div class = 'row'>"
html += "<div class='col-sm-2 uno_part_wrapper'>"
html += "<label class = 'p_name' for='#{attr_name}'>"
"data-part-type" =>"#{part_child.display_type}",
html += image_tag o.photo(:small), class: "tick_option_img",
"data-option-name" => o.name
html += "</label>"
html += "</div>"
html += "</div>"
end
html.html_safe
end
Here I am trying to run each loop after every col-sm-2
, I am getting thi s error when I am trying to run the app.
undefined method `id' for Array:0x007f0e282d61c0>
The error line it shows in the view where there's nothing as id
.
Tried to get tthis but couldn't get it working
Please help me figutr this out.