我对 Rails 还是很陌生,而且很多都不是我习惯的。找不到我的答案,实际上也不知道要搜索什么,所以请帮忙。
这是:
def create
@note = Note.new(params[:note])
@note.creator = current_user
if member_of_project? @note.project_id
if @note.save
redirect_to @note, :notice => "Successfully created note."
else
render :action => 'new'
end
else
render :action => 'new'
end
end
等于:
def create
@note = Note.new(params[:note])
@note.creator = current_user
if member_of_project? @note.project_id && @note.save
redirect_to @note, :notice => "Successfully created note."
else
render :action => 'new'
end
end
???
我真正想知道的是第二个是否会打电话@note.save
。