【发布时间】:2013-04-19 12:15:54
【问题描述】:
我有一点检入模型:
class Customers < ActiveRecord::Base
def check_user_name(name, email)
name = Customers.where(:name => name)
email = Customers.where(:email => email)
if name && email
@answer = 'Question was send to us. Thank you.'
else
@answer = 'ERROR, no such name or email.'
end
end
end
并查看(haml 文件):
=@answer
但页面上没有文字......空......请解释一下为什么?)
【问题讨论】:
-
你对控制器和模型有区别吗?
标签: ruby-on-rails haml