Rails 3 提供了 match
方法供我们自定义 routes,然而我们要小心使用它以避免“跨站脚本攻击”(XSS Attack)。比如像这样的 routes:
注:(r3 代表 Rails 3,r4 代表 Rails 4)
# routes.rb
#! /usr/bin/env python | |
import os | |
import psycopg2 | |
import MySQLdb | |
PG = { | |
'name' : 'moodle_rvt_sociales', | |
'user' : 'diegueus9', | |
'pass' : 'fuseki', | |
'host' : 'localhost', |