Here’s what I’ve got:
<% @fields.each do |field_name| %>
Right now this works great if I only have “state_id” as the related
field_name. I could repeat this for every field_name ending in “_id”,
but that’s not DRY.
I’d like to allow this to work for any field_names ending in “_id” but I
need to use the field_name without the “_id” and capitalized as the
class name. I know I’m thinking about this from a scripting POV, but
can I get this done?
Is there a better way to do this?