Way to get the form name/id from a form_for (default) builder?

Hi all,

I’d like to be able to refer to a form being created by form_for from
javascript. To do this, I’d like to know what will be the id and/or
name that’s going to be set on the form. I understand I can override
the id or name, but i’d prefer not to.

For instance, I’m looking for something to fill in

<% form_for :role, … %>
Press Me</
<%= form.select(:rights, … %>
<% end %>

Thanks in advance!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs