【发布时间】:2015-06-19 06:58:41
【问题描述】:
有以下代码:
class MyModel < ActiveRecord::Base
before_create :do_process
def do_process
#I want to print here everything that came to this method
self.my_stuff = my_stuff
end
假设我们有具有name 和description 属性的模型,并且
我要进入控制台并输入类似的内容
MyModel.create! name: 'test', description: 'test'
那么如何查看传递给方法do_process 的参数?
【问题讨论】:
-
你的方法没有任何反应,这是什么意思?
-
我不太明白你的问题 - 你想检查你的方法中传递了哪些参数?
标签: ruby-on-rails ruby ruby-on-rails-3 console