Rails STI and form_forWritten August 14, 2012. Tagged Ruby on Rails, STI. Rails' form_for conveniently uses "record identification" to figure out the correct URL based on the model: = form_for([:admin, @item]) do |f| = f.text_field :nameIt's also used to figure out the HTTP verb, the field name prefixes, HTML classes and HTML id. So this form would POST to admin_items_path for a new record, or PUT
![Rails STI and form_for](https://cdn-ak-scissors.b.st-hatena.com/image/square/202b9e84a7a9cf74f68ff3637f6279d61ff11a84/height=288;version=1;width=512/https%3A%2F%2Fthepugautomatic.com%2Fimages%2Fog.png)