无论如何,自定义Ruby on Rails操作都会重定向到本地主机

时间:2014-02-04 15:35:03

标签: ruby-on-rails

我想在我的一个控制器中创建一个新动作,但是我写入它只是重定向到localhost的动作并不重要。

在我的routes.rb中:

match '/save_last_updated' => 'forum_topics#save_last_updated'

在forum_topics_controller.rb

def save_last_updated
  //I tried here everything, raise error, redirect, render, but none of them work.
end

即使是控制台也没多大帮助:

Processing by ForumTopicsController#save_last_updated as HTML
Redirected to http://localhost:3000/
Completed 302 Found in 24.8ms (ActiveRecord: 0.0ms)

我的总体目标是使用jquery ajax请求调用该操作,以便操作更新数据库。

0 个答案:

没有答案