Routing error in rails

Posted by user662503 on Stack Overflow See other posts from Stack Overflow or by user662503
Published on 2012-10-26T08:02:20Z Indexed on 2012/10/26 11:01 UTC
Read the original article Hit count: 141

Filed under:

In my controller I have

def update_project_dates
  p "It is end date....."
  @user=User.find(params[:user])
  @projects=Project.find_all_by_user_id(@user)
end

In the view page (only some part of the code is copied and pasted)

eventDrop: function() 
{ 
  $.ajax({
    url:'/update_project_dates/',
    success:function(data)
    {
    alert("Hello");
    }
  })
},

In my routes.rb I have mentioned

match '/update_project_dates' => 'users#update_project_dates', :method=> :get
get 'update_project_dates'

But When the ajax request goes, I get the routing error as

Routing Error

uninitialized constant UsersController

Where am I doing wrong here...Please help..

© Stack Overflow or respective owner

Related posts about ruby-on-rails-3