jdn7d

Joined

50 Experience
0 Lessons Completed
0 Questions Solved

Activity

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