如何以下列方式访问我的记录
而不是典型的$sql = 'INSERT INTO downloads AS d (nome, email, estado, arquivo, acessos)
VALUES ($1, $2, $3, $4, 1)
ON CONFLICT ON (nome, email) DO UPDATE
SET acessos = EXCLUDED.acessos + 1';
时尚?
答案 0 :(得分:1)
您可以使用friendly-id
gem。有关它的更多信息,请参见GitHub
railscasts中的教程: http://railscasts.com/episodes/314-pretty-urls-with-friendlyid?view=asciicast