我尝试过改变祖先模型的所有兄弟姐妹(从活动模型代码)母公司: def change_parents_of_siblings
to_change = self.siblings.where.not(id: self.id)
to_change.each do |sib|
sib.update!(parent: self)
end
end
如果我打印功能里
我想将此字符串分成4个变量。 “Sun Aug 28 2016 00:00:00 GMT + 0600(Central Asia Standard Time)” 我想变得像这样,var day =“Sun”var month =“Aug”var year = 2016; 我该如何在纯js中做到这一点?
我对我的应用程序使用Rails 2.3.4/Ruby 1.9.1。在视图中我有这样的显示错误消息: <%= content_tag('div', flash[:notice], :class => 'flash notice') if flash[:notice] %>
它工作正常,如果我手动分配从控制器如: flash[:notice] = "User Name can only conta