ERROR: No route matches [GET] "/bookings/:id/%3E:format"
I want to update an attribute when click on link of 'link_to'..
<%= link_to 'Cancel', '/bookings/:id/(.:format)' %>
routes.rb
put '/bookings/:id/(.:format)' => "bookings#tocancel"
patch '/bookings/:id/(.:format)' => "bookings#tocancel"
controller
def tocancel
@booking = Booking.find(params[:id])
@booking.update_attribute(:status, "cancel")
respond_to do |format|
format.html { redirect_to @booking, notice: 'Booking was successfully cancelled.' }
format.json { render :show, status: :ok, location: @booking }
end