我写了controlloer为什么这些代码无法按预期工作?
class NotificationsController < ApplicationController
before_filter :authenticate_user!
def index
@notification = current_user.notification
if @notification.unread == 0
redirect_to root_path
else
@notification.unread == 0
@notification.save
end
end
end
,我希望@notification.unread
为0后显示指数page.But不能实际工作。 如何更改这些代码以使其正常工作。
希望你能帮助我,非常感谢:)
哦,我做出了这样的严重错误。 :( – hsming 2013-03-25 15:27:02