2013年11月25日 星期一

[程式] Rails - Route

  • match "<path>", to: "<controller>#<action>"
    = match "<path>" => "<controller>#<action>"
  • Get
    match "<path>", to: "<controller>#<action>", via: :get
    = get "<path>", to: "<controller>#<action>"
    = get "<path>" => "<controller>#<action>"
  • Post
    match "<path>", to: "<controller>#<action>", via: :post
    = post "<path>", to: "<controller>#<action>"
    = post "<path>" => "<controller>#<action>"

  • multiple verbs
    match "<path>", to: "<controller>#<action>", via: [:get, :post]
  • No constraints
    match "<path>", to: "<controller>#<action>", via: :all

沒有留言:

張貼留言