0
我有這種功能,在瀏覽器的遊戲我正在做:填充變量
def sendAllianceInvitationMessage(invited_user, alliance)
subject = 'Alliance Invitation'
body = 'You have received an invitation to join the alliance ' + alliance.name + '.'
body += ' Please visit the Alliance Menu in order to accept or reject alliance invitations.'
current_user.sendMessage(invited_user, subject, body, 'alliance invitation')
end
我真的不舒服,在這種方式加載身體的想法。是否有可能有一個部分接收參數(如代碼中的alliance.name),生成正文內容並將其傳遞給sendMessage中使用的字符串變量?
偉大謝謝! – Spyros 2011-02-01 10:21:25