【发布时间】:2013-01-11 04:39:59
【问题描述】:
在我的应用程序中,我有一个带有一些代码的控制器操作..
users_controller.rb
def my_method(age)
if age >18
flash[:notice]= "You are eligible."
else
flash[:notice]= "You are not eligible."
end
end
我正在通过 jquery 调用 my_method...(编码在 jquery 对话框的提交按钮上)
jQuery.post('/users/my_method/', { age: jQuery('#age').val() });
但它没有显示闪存消息,但在日志中我看到正在调用方法“my_method”。告诉我如何显示这些 Flash 消息?
【问题讨论】:
标签: jquery ruby-on-rails jquery-ui