I have a problem with content_tag into an helper, this piece of code
def renderize(place_holder)
content_tag(:div, "hello") do
@raw_estimate.field_estimates.where(:field_position_id => FieldPosition.where(:place_holder => place_holder).first).each do |field|
if field.field_type.alias == "input"
content_tag :div do
field.is_validate ? label_value = "*#{field.name}" : label_value = field.name
content_tag(:label_tag, label_value) +
text_field_tag("estimate[field_#{field.name.downcase.gsub(/\W+/, '')}]")
end
end
end
end
end
does not return anything, what am I missing?
Thank you
don’t use each for interacting array, use collect will will return an array of your rendered tags see http://apidock.com/rails/ActionView/Helpers/TagHelper/content_tag for the last few comments