如何在同一个控制器中调用其他操作?
然后我想通过@community or @user
并params[:comment][:body]
到part_two
我目前的代码是这样的。
def part_one
if params[:mode] == "1"
@community = Community.find(params[:id])
@body = "This is for Community"
elsif params[:mode] == "2"
@user = User.find(params[:id])
@body = "This is for User"
end
params[:comment][:body] = @body
-----here I want to call action [part_two]-------
end
def part_two
transaction that needs @community or @user, and params[:comment][:body]
end