From c44aa17da0c08fcfff11eaa1ff03f6cab6bd0eb0 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 25 Jan 2018 12:05:23 +0100 Subject: AF83::Decorator::Link: Add `data-method` to HTML options Previously, we weren't correctly adding the HTTP method to the links in the header. This is because it's called `link_method` in the class. Put this value in `method`/`data-method` when converting the link to HTML so that the links work properly. Discovered this when deactivating and activating stop areas on http://stif-boiv.dev:3000/stop_area_referentials/1/stop_areas/139429 . Refs #5586 --- lib/af83/decorator/link.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/af83/decorator/link.rb b/lib/af83/decorator/link.rb index 55db3f5bb..7d2896e6a 100644 --- a/lib/af83/decorator/link.rb +++ b/lib/af83/decorator/link.rb @@ -126,6 +126,7 @@ class AF83::Decorator::Link options.each do |k, v| out[k] = self.send(k) unless k == :content || k == :href || k.to_s =~ /^_/ end + out[:method] = link_method out[:class] = extra_class out.delete(:link_class) out[:class] += " disabled" if disabled -- cgit v1.2.3