Ruby on Rails Thursday, October 27, 2016

I figured out how to achieve that:

<%= f.collection_radio_buttons :name, [[true, 'H<sub>2</sub>O'] ,[false, 'SO<sub>2</sub>']], :first, :last do |b| %>
       
<%= b.label {b.radio_button + sanitize(b.text, tags: %w(sub sup))}%>
 
<%end%>


On Wednesday, 26 October 2016 12:45:48 UTC+2, Serguei Cambour wrote:
How is it possible to call sanitize on the below collection_radio_buttons method:

= f.collection_radio_buttons :answer_ids, @question.answers, :id



I tried as follows and it failed:

= f.collection_radio_buttons :answer_ids, @question.answers, :id, sanitize(:text, tags: %w(sub sup))

Any idea? Thank you.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/30f058a2-9d61-4ce8-bfbd-8b07aa1c7eb4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment