这可以用html按钮为页面添加书签吗?
<button>Bookmark This page</button>
Run Code Online (Sandbox Code Playgroud)
<button>Bookmark This page</button>
Run Code Online (Sandbox Code Playgroud)
function onclickfunction(){
alert('Press Ctrl + D to bookmark this page');
}Run Code Online (Sandbox Code Playgroud)
此代码指导您如何在 chrome 中为页面添加书签。但我想打开一个对话框,我们在谷歌浏览器中按完成。
我想skill在MySQL表中插入调用skills.
我有skills作为param[:skills] = "Lorem, Ipsum, Is, A, Dummy, Text"
我想将它们插入MySql DB.
我使用的方式是:
def skill_to_add
skills = params[:skills].split(',')
skills.each do |s|
find_skill = Skill.find_by(:skill => s)
if find_skill
find_skill.update(:skill_count => find_skill.skill_count + 1)
else
Skill.create(:skill => s, :skill_count => 1)
end
end
end
Run Code Online (Sandbox Code Playgroud)
做这件事的干净方法是什么?