ruby on rails - How to make the label title and input value the same, but id is different -


I have questions, how can I create a label title and input value, but the ID is different. What do I need from the code given below

  & lt;% = f.input: building_type ,: label_html = & gt; {: class = & gt; "ui-priority n1"}, label: "building type", archive: post :: flat :: building card, e.g. :: radio% & gt; Post :: Flat :: BUILDING_TYPES = Output code:  
 < Code> & lt; Div class = "radio" & gt; & Lt; label class = "post_flat_building_type-1" for "likes" & gt; & Lt; input id = "post_flat_building_type-1" name = "post_flat [building_type]" type = "radio" value = "1" & gt; Flat-top & lt; / Labels & gt; & Lt; / Div & gt; & Lt; Div class = "radio" & gt; & Lt; label class = "post_flat_building_type-2" for "likes" & gt; & Lt; input id = "post_flat_building_type-2" name = "post_flat [building_type]" type = "radio" value = "2" & gt; Flat-mid & lt; / Labels & gt; & Lt; / Div & gt;   

But I want to make the value equal to flat-flat, flat-centered , how can I get it?

Thanks any help!

FormStastic Edition - 2.3 Formatistic-Bootstrap Version - 3.0

----- Some Extra ----

Someone says I can

  post :: flat :: BUILDING_TYPES = [["flat super", "flat super"], ["flat-medium", "flat" change to this problem by the initial array Solution - Middle "]]   

But if I Cyrillic

  post :: flat :: BUILDING_TYPES = [[it does not work 'd ?? D Ñ ?? Ð¿Ð¸Ñ ?? Ð½Ñ ?? й "," d ?? DN ?? Ð¿Ð¸Ñ ?? Ð½Ñ ?? = "Post_flat_building_type"> = "post_flat_building_type" name = "post_flat [building_type]" = "post_flat_building_type" for the "label" = "likes"); 

You can see That's the wrong ID in the output, it affects if I have more than one object in my 1. All inputs will be of the same ID.

Only when the check box and radiobuttons are created, try to hack the formtastic from cyrrilic to Latin, transliting characters when attribute id input and attribute for label Module FormTastic module Input module base module option DEF choice_html_safe_value (like) name = Translit.convert (choice_value (like) .to_s, English) name.gsub (/ \ / s, '_') .gsub (/ [^ \ w -] /, ''). Downcase and end # option end and end

You can use the gem After hacking itself with translit or translit yourself, the formattic will generate something like this:

  


Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -