Rails 3 提供了 match
方法供我们自定义 routes,然而我们要小心使用它以避免“跨站脚本攻击”(XSS Attack)。比如像这样的 routes:
注:(r3 代表 Rails 3,r4 代表 Rails 4)
# routes.rb
#!/bin/bash | |
#cut/join videos using ffmpeg without quality loss | |
if [ "$(uname)" == "Darwin" ]; then | |
if ! [ -x "$(command -v brew)" ]; then | |
echo 'homebrew is not installed.' | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
fi | |
if ! [ -x "$(command -v ffmpeg)" ]; then | |
echo 'ffmpeg is not installed.' |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"strconv" | |
"time" | |
) | |
type CustomTime struct { |