How to prevent polluting a rails object when using form_for and .new?
问题 I have a model: class Activity < ActiveRecord::Base has_many :activity_states end I want to render options for new activity states and render existing activity states. However when I use this form_for: <%= form_for activity.activity_states.new, :remote => true do |f| %> <%= f.hidden_field :state_type, :value => activity_state_type %> <%= f.hidden_field :activity_id %> <%= f.submit submit_label, :disable_with => 'sending...' %> <% end %> for creating new temporary activity_state models to use