任何人都可以解釋"#{self.key}"
和"vynd6tg1hh"
之間的區別"#{self.key}"
打印出"vynd6tg1hh"
?「#{self.key}」和「vynd6tg1hh」之間有什麼區別?
我有哪裏"#{self.key}"
不工作的方法,但是在字符串中直接把做:
def get_wistia_media
Wistia::Media.get(wistia_key)
end
不一起工作:
def wistia_key
"vynd6tg1hh"
end
:
def wistia_key
"#{self.key}"
end
是否與工作
我不明白。
編輯1:'不工作'我的意思是,當我使用「#{self.key}」時,該方法會得到'404錯誤'。
編輯2:他們都在我的視頻模型。
定義「不起作用」 –
什麼是上下文,什麼是自我?這些方法在同一個班級嗎?我對我毫無意義。 – calas
您是否在控制檯中嘗試過?什麼是輸出:'video = Video.first; Wistia :: Media.get(video.key.to_s)'? – calas