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 <%= @trip.location %>

<%= 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
Reply

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

Reply
Join the discussion
Create an account Log in

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

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

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