ruby - Rails 5: can't access update method in view -


i'm trying update attribute single button so:

<%= link_to loan_product, lead_path(@lead, lead: { loan_product: loan_product }, method: :patch) %> 

the params come through fine, lead_path accesses show method of controller , not update 1 despite method being set either :patch or :put, , because of attribute isn't updated.

how can point link_to default update method in controller? i'm rocking default resources in routes.rb, i.e., resources :leads.

as said in comment:

the option method: :patch given arg lead_path method, should passed link_to instead:

<%= link_to loan_product, lead_path(...), method: :patch %>  

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -