开发者

Rails 405 Method not allowed

开发者 https://www.devze.com 2023-01-12 19:07 出处:网络
I have开发者_如何学编程 a select box and on every change I am going back to my controller and fetching some data. This data is then loaded into a div.

I have开发者_如何学编程 a select box and on every change I am going back to my controller and fetching some data. This data is then loaded into a div.

jQuery:

   $('#groups').change(function() {
       $('#emails').load('/notifications/get', {value: $(this).val()});
  });

Controller:

  class NotificationsController < ApplicationController
      def get
        return "test"
      end
  end

View:

  <div id="groups" class="left">
<%=select_tag 'employee[group_id][]', options_for_select( current_user.groups.map {|s| ["#{s.name} - #{s.description} (" + s.employees.find(:all, :conditions=>{:subscribed=>true}).count.to_s+")", s.id]}), :multiple => true, :size =>6, :style  => "width:250px"%>
  </div>

  <p id="emails"> </p>

When I try to debug with firebug I see that error is 405 method not allowed ..furthermore response that comes back says

Only get, put, and delete
requests are allowed.


Do you have a route set for that action?

0

精彩评论

暂无评论...
验证码 换一张
取 消