I am having the following form in my profile/edit.html.erb
<%= form_for @customer, url: {controller: :customer, action: :update} do |f| %>
<%= f.text_field :username, value: @customer.username%>
<%= f.submit 'Update' %>
<% end %>
And in my customer controller i have following method
def edit
@customer = Customer.find session[:customer_id]
end
def update
@customer.update(customer_params)
end
private
private
def customer_params
params[:customer]
end
When i submit the form getting route error
No route matches [PATCH] "/customer/update"
I have added following line in route.rb then too facing same error
resources :profiles
resources :customers