When using the form_for helper and a text_field call, Ruby on Rails will generate a unique id for the element that it outp
form_for
text_field
In Rails 4.1 I was able to get the id with this:
ActionView::Base::Tags::Base.new( f.object_name, :username, :this_param_is_ignored, ).send(:tag_id)
It works with nested forms (fields_for).
fields_for