Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8946887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:36:35+00:00 2026-06-15T12:36:35+00:00

I am trying to post a form to a Rails controller using jQuery and

  • 0

I am trying to post a form to a Rails controller using jQuery and AJAX however I am getting this error:

Started GET "/subscription_mails/14/create_recipients?utf8=%E2%9C%93&_method=put&authenticity_token=8HtssDY3kxnRlplQbBGlpUspL5ZLq4PqdgiiL5d73yQ%3D&group_ids%5B%5D=3&subscription_mail%5Btarget_users%5D=0&subscription_mail%5Btarget_owners%5D=0&subscription_mail%5Btarget_teachers%5D=0&subscription_mail%5Btarget_teachers%5D=1&subscription_mail%5Btarget_subscribers%5D=0" for 127.0.0.1 at 2012-11-29 19:59:47 +0000

ActionController::RoutingError (No route matches [GET] "/subscription_mails/14/create_recipients"):
  actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
  railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
  quiet_assets (1.0.1) lib/quiet_assets.rb:20:in `call_with_quiet_assets'
  actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.1) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.1) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
  airbrake (3.0.9) lib/airbrake/user_informer.rb:12:in `call'
  railties (3.2.3) lib/rails/engine.rb:479:in `call'
  railties (3.2.3) lib/rails/application.rb:220:in `call'
  railties (3.2.3) lib/rails/railtie/configurable.rb:30:in `method_missing'
  rack-block (0.1.1) lib/rack/block.rb:47:in `call'
  rack (1.4.1) lib/rack/content_length.rb:14:in `call'
  railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
  thin (1.3.1) lib/thin/connection.rb:80:in `block in pre_process'
  thin (1.3.1) lib/thin/connection.rb:78:in `catch'
  thin (1.3.1) lib/thin/connection.rb:78:in `pre_process'
  thin (1.3.1) lib/thin/connection.rb:53:in `process'
  thin (1.3.1) lib/thin/connection.rb:38:in `receive_data'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine'
  eventmachine (0.12.10) lib/eventmachine.rb:256:in `run'
  thin (1.3.1) lib/thin/backends/base.rb:61:in `start'
  thin (1.3.1) lib/thin/server.rb:159:in `start'
  rack (1.4.1) lib/rack/handler/thin.rb:13:in `run'
  rack (1.4.1) lib/rack/server.rb:265:in `start'
  railties (3.2.3) lib/rails/commands/server.rb:70:in `start'
  railties (3.2.3) lib/rails/commands.rb:55:in `block in <top (required)>'
  railties (3.2.3) lib/rails/commands.rb:50:in `tap'
  railties (3.2.3) lib/rails/commands.rb:50:in `<top (required)>'
  script/rails:6:in `require'
  script/rails:6:in `<main>'

I am not sure why I am getting this error as I have the path defined in my routes. This is my form:

{ :id => “mail-form”, :method => :put } do |f| %>

This is the code in my routes file:

  resources :subscription_mails do
    put 'create_recipients' => "subscription_mails#create_recipients"
  end

And this is my jQuery:

$('#save-config').click(function(){
  $.ajax({
    url: $('form#mail-form').attr('action'), //sumbits it to the given url of the form
    data: $('form#mail-form').serialize(),
    dataType: "JSON" // you want a difference between normal and ajax-calls, and json is standard
  }).success(function(json){
  //act on result.
  });
  return false; // prevents normal behaviour
});

I’m struggling to figure this out and would really appreciate some help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:36:36+00:00Added an answer on June 15, 2026 at 12:36 pm

    Looks like your AJAX request is using the GET verb (default), rather than PUT, which is what you defined in the route. Run rake -T to confirm required method and path, then in your AJAX, add type: 'PUT', in there somewhere.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to send post request using rails controller, however i faced issue, when
I am trying to use jQuery with Rails and AJAX to accept a post
I'm trying to get a simple file upload working using jquery-fileupload-rails carrierwave fog I
I am trying to get post a form to a hidden, dynamically inserted iframe,
I am trying to post a multi-part form using httplib, url is hosted on
I am trying to post an image to a Facebook album using a form
I am trying to get some form data from POST method. Here's the code
i am trying to test jquery post. I am posting a form and want
I'm trying to access the post target action in a jquery function. example: <form
I've gone through the getting started with rails tutorial and now i'm trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.