我有一个页面,我不想出现在菜单中,除非用户已经在该页面上或它下面的一个子页面。
例如,在购物网站上,我希望在“产品”页面下的菜单中有一个“特殊优惠”页面,但是只有当你在特殊优惠页面上而不是在产品页面上时,它才是可见的。
例如标准菜单
Home
Products
Contact us
当在特别优惠页面上:
Home
Products
Special offers
Contact us
是否有办法达到这一效果?
对于RHEL/Fedora的更新测试回购,等效的CentOS 6回购是什么?我试图遵循node.js安装说明这里,并且很难弄清楚要为CentOS 6添加什么回购。
Error getting repository data for updates-testing, repository not found
song=['Avicii - The Nights.mp3','RootkitPromiseMe.mp3','MajorLazer-Light.mp3']
while True:
for songs in song:
mixer.init()
mixer.music.load(songs)
mixer.music.play()
我怎样才能一首接一首地播放这些歌曲呢?它可以工作,但它只播放第一个音频,而不播放第二个音频。有没有办法让程序一首接一首地运行?
我有优惠券模型,在这个模型文件中我有一个方法,我想列出优惠券如果coupon.suitable_for_use ==真.Is有什么简单的方法吗?这段代码是我写的,但不起作用。
@coupons = []
coupons = Coupon.all.each do |coupon|
if coupon.suitable_for_use
@coupons << coupon
end
end
@coupons = coupons
suitable_for_use方法
def suitable_for_use
result = true
if is_used?