i have some code to display here
<%= form_for @campaign, url: brands_campaign_path(@campaign), method: :patch, :html => {:multipart => true, :class => 'form-horizontal'} do |f| %>
and it generates the following
<form class="form-horizontal" id="edit_campaign_25" enctype="multipart/form-data" action="/campaigns/testing" accept-charset="UTF-8" method="post">
<input name="utf8" type="hidden" value="✓" />
<input type="hidden" name="_method" value="patch" />
<input type="hidden" name="authenticity_token" value="Ybl3G26TZumVbbCew2EmlVxq4Dv2JZx5PAq1Q7nup3vp0GdkT72oIlV==" />
However, despite this setup, I am receiving a POST request on the server-side. The jquery_ujs.js
file is also loading properly in the browser.
rake routes
brands_campaigns GET /campaigns(.:format) brands/campaigns#index {:subdomain=>"brands"}
POST /campaigns(.:format) brands/campaigns#create {:subdomain=>"brands"}
new_brands_campaign GET /campaigns/new(.:format) brands/campaigns#new {:subdomain=>"brands"}
edit_brands_campaign GET /campaigns/:id/edit(.:format) brands/campaigns#edit {:subdomain=>"brands"}
brands_campaign GET /campaigns/:id(.:format) brands/campaigns#show {:subdomain=>"brands"}
PATCH /campaigns/:id(.:format) brands/campaigns#update {:subdomain=>"brands"}
PUT /campaigns/:id(.:format) brands/campaigns#update {:subdomain=>"brands"}
DELETE /campaigns/:id(.:format) brands/campaigns#destroy {:subdomain=>"brands"}
brands_campaigns_posts GET /campaigns/:id/posts(.:format) brands/campaigns#posts {:subdomain=>"brands"}
brands_campaigns_details GET /campaigns/:id/details(.:format) brands/campaigns#details {:subdomain=>"brands"}
brands_campaigns_influencers GET /campaigns/:id/influencers(.:format) brands/campaigns#influencers {:subdomain=>"brands"}
brands_campaigns_submit_for_approval GET /campaigns/:id/submit_for_approval(.:format) brands/campaigns#submit_for_approval {:subdomain=>"brands"}
brands_campaigns_pending_to_draft GET /campaigns/:id/pending_to_draft(.:format) brands/campaigns#pending_to_draft {:subdomain=>"brands"}
brands_campaigns_cancel GET /campaigns/:id/cancel(.:format) brands/campaigns#cancel {:subdomain=>"brands"}
brands_campaigns_add_credits GET /campaigns/:id/add_credits(.:format) brands/campaigns#add_credits {:subdomain=>"brands"}
logs
ActionController::RoutingError (No route matches [POST] "/campaigns/testing/edit"): actionpack (4.2.5.2)
lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' rollbar (2.14.0)
lib/rollbar/middleware/rails/show_exceptions.rb:22:in `call_with_rollbar' web-console (2.3.0)
lib/web_console/middleware.rb:20:in `block in call' web-console (2.3.0)
lib/web_console/middleware.rb:18:in `catch' web-console (2.3.0)
lib/web_console/middleware.rb:18:in `call' actionpack (4.2.5.2)
lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.2.5.2)
lib/rails/rack/logger.rb:38:in `call_app' railties (4.2.5.2)
lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.2.5.2)
lib/active_support/tagged_logging.rb:68:in `block in tagged' activesupport (4.2.5.2)
lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (4.2.5.2)
lib/active_support/tagged_logging.rb:68:in `tagged' railties (4.2.5.2)
lib/rails/rack/logger.rb:20:in `call' actionpack (4.2.5.2)
lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.6.5)
lib/rack/methodoverride.rb:22:in `call' rack (1.6.5)
lib/rack/runtime.rb:18:in `call' activesupport (4.2.5.2)
lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' rack (1.6.5)
lib/rack/lock.rb:17:in `call' actionpack (4.2.5.2)
lib/action_dispatch/middleware/static.rb:116:in `call' rack (1.6.5)
lib/rack/sendfile.rb:113:in `call' railties (4.2.5.2)
lib/rails/engine.rb:518:in `call' railties (4.2.5.2)
lib/rails/application.rb:165:in `call' rack (1.6.5)
lib/rack/tempfile_reaper.rb:15:in `call' rack (1.6.5)
lib/rack/lint.rb:49:in `_call' rack (1.6.5)
lib/rack/lint.rb:37:in `call' rack (1.6.5)
lib/rack/showexceptions.rb:24:in `call' rack (1.6.5)
lib/rack/commonlogger.rb:33:in `call' sinatra (1.4.7)
lib/sinatra/base.rb:219:in `call' rack (1.6.5)
lib/rack/chunked.rb:54:in `call' rack (1.6.5)
lib/rack/content_length.rb:15:in `call' unicorn (5.2.0)
lib/unicorn/http_server.rb:562:in `process_client' unicorn (5.2.0)
lib/unicorn/http_server.rb:658:in `worker_loop' unicorn (5.2.0)
lib/unicorn/http_server.rb:508:in `spawn_missing_workers' unicorn (5.2.0)
lib/unicorn/http_server.rb:132:in `start' unicorn (5.2.0)
bin/unicorn:126:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.3.1/bin/unicorn:23:in `load'
/usr/local/rvm/gems/ruby-2.3.1/bin/unicorn:23:in `<main>'
/usr/local/rvm/gems/ruby-2.3.1@global/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.3.1@global/bin/ruby_executable_hooks:15:in `<main>'
What Route it should hit as it does on Firefox
Started PATCH "/campaigns/testing" for 106.51.30.182 at 2017-02-06 11:18:02 -0500