在我的 mac 根目录下,我有 .bashrc、.aliases、.zshrc...,然后在另一个文件夹中,我有相同点文件的 git 存储库。当我更新根目录时,我也会更新 git 存储库(手动)。有没有某种方法可以将根文件夹中实际实现的点文件“链接”到 git 存储库,这样我只需处理一项更改?
我有这样的代码
list << num if num.to_s.split("").map(&:to_i).map(&:factorial).inject(:+) == num
Run Code Online (Sandbox Code Playgroud)
它工作,我想知道如果inject没有&(&符号)前面的工作:+.我要求别人解释的差异之间有什么:+和&:+.
是什么之间的差异:
http://localhost:3000/courses/edit.2
and
http://localhost:3000/courses/edit?id=2
Run Code Online (Sandbox Code Playgroud)
它由<%= edit_courses_path(course)%>生成
和link_to({action :: edit,id:course.id})分别
http://localhost:3000/courses/edit.2 # This link does not work
http://localhost:3000/courses/edit?id=2 # This link works
Run Code Online (Sandbox Code Playgroud)
我该怎么做才能使这两个链接都有效?