title: Nested Resources w/ Rails 5.1 form_with
body: <p>Per <a href="https://github.com/rails/rails/issues/25197" rel="noreferrer">this pull request</a> I can see that an array should be passed to <code>form_with</code>'s model param. However, when I supply the following:</p>
  
  <pre><code>&lt;%= form_with(model: [@trip, @activity], local: true) do |f| %&gt;
    ...
  &lt;% end %&gt;
  </code></pre>
  
  <p>Rails will return - <code>ActionView::Template::Error (undefined method activity_path' for #&lt;#&lt;Class:0x007f80231e3070&gt;:0x007f8023010dd8&gt;):</code></p>
  
  <p>My routes file looks like:</p>
  
  <pre><code>  resources :trips do
      resources :activities
    end
  </code></pre>
  
  <p>The output of <code>rake routes</code> looks like - </p>
  
  <pre><code>     trip_activities GET    /trips/:trip_id/activities(.:format)          activities#index
                       POST   /trips/:trip_id/activities(.:format)          activities#create
     new_trip_activity GET    /trips/:trip_id/activities/new(.:format)      activities#new
    edit_trip_activity GET    /trips/:trip_id/activities/:id/edit(.:format) activities#edit
         trip_activity GET    /trips/:trip_id/activities/:id(.:format)      activities#show
                       PATCH  /trips/:trip_id/activities/:id(.:format)      activities#update
                       PUT    /trips/:trip_id/activities/:id(.:format)      activities#update
                       DELETE /trips/:trip_id/activities/:id(.:format)      activities#destroy
                 trips GET    /trips(.:format)                              trips#index
                       POST   /trips(.:format)                              trips#create
              new_trip GET    /trips/new(.:format)                          trips#new
             edit_trip GET    /trips/:id/edit(.:format)                     trips#edit
                  trip GET    /trips/:id(.:format)                          trips#show
                       PATCH  /trips/:id(.:format)                          trips#update
                       PUT    /trips/:id(.:format)                          trips#update
                       DELETE /trips/:id(.:format)                          trips#destroy
  </code></pre>
  
  <p>And my activities_controller.rb - </p>
  
  <pre><code>  before_action :set_activity, only: %i[show update edit destroy]
  
    def edit; end
  
    def update
      dates = calculate_datetimes(params[:date_range])
      @activity.assign_attributes(name: params[:name],
                                  summary: params[:summary],
                                  start_datetime: dates[0],
                                  end_datetime: dates[1])
      if @activity.save
        flash[:success] = 'Activity successfully updated'
        redirect_to(@trip)
      else
        set_humanized_daterange
        render :edit
      end
    end
  
    private 
  
    def set_activity
      @activity = Activity.find(params[:id])
    end
  </code></pre>
  
  <p><strong>tl;dr</strong> - how should I setup my form_with for a nested resource, and why is this form thinking I want to use the <code>activity_path</code>? Ideally I'd like to move this form into a partial and use the same form for both my #new and #edit actions.</p>