1

first, sorry for my bad english, i don't like for translators rs, well, i'm trying to recover a id at checkbox field using dinamic id content, i'm using this in datatable code for my rails application:

"<input type='checkbox' id='#{ record.archetype_file_name }'>",

and it will be returned at my browser like as

<input id="CEN-EN13606-ENTRY.Deficiencias.v1.adl" type="checkbox">,

,

my doubt is: these points and other special characters vain to stop me from using this id and stuff , what do you suggest me ?

  • Do you mean that you want the html `id` to be dynamic with the content? – x6iae Nov 03 '15 at 17:28
  • 2
    Possible duplicate of [What are valid values for the id attribute in HTML?](http://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html) – Gyrocode.com Nov 03 '15 at 17:34
  • If you need to get dynamic `id`s in rails, you can use the `ActionView::RecordIdentifier`. This provides you with some methods like: `div_for`, `dom_name`, `dom_id`, etc... In your case, I think what you want is the `dom_id`. [You can check the documentation out here.](http://api.rubyonrails.org/classes/ActionView/RecordIdentifier.html) – x6iae Nov 03 '15 at 17:39

0 Answers0