Nest input inside f.label ( rails form generation )

前端 未结 5 447
广开言路
广开言路 2020-12-28 17:22

I want to use the f.label method to create my form element labels, however - i want to have the form element nested inside the label. Is this possible?

-- From W3C --

5条回答
  •  春和景丽
    2020-12-28 17:54

    This isn't possible using the built-in Rails' label or label_tag helpers because they don't take a block. However, if you want nesting then why wouldn't you just use the HTML element directly?—

    
    

提交回复
热议问题