All threads / Why would I be receiving a NoMethoError when I try to go to the trips edit form?

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Why would I be receiving a NoMethoError when I try to go to the trips edit form?

jdn7d asked in Rails

edit.erb

Edit

<%= button_to "Delete trip", trip_path(@trip), method: :delete %>

<%= link_to "Cancel", trip_path(@trip) %>

trips_controller.rb

def update 
    if @trip.update(trip_params) 
       redirect_to trip_path(@trip)
    else
       render :edit
    end
 end

Could you share the link to your code and exact error message? Without them we can just guess, not dig into the problem.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 54,645+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

    © 2021 GoRails, LLC. All rights reserved.