This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
commit 8068a7119e33fcc3ba2b57f3d56fd218622bc246
tree 6f5bd1f0ebf9e9da67d6341fbb8b4eea5fbdcdd4
parent c2fc436e11ba8ee8ae857534b83ca217f27447b4 parent 4907a07e219f055b093604f2f681c8597db8ad49
tree 6f5bd1f0ebf9e9da67d6341fbb8b4eea5fbdcdd4
parent c2fc436e11ba8ee8ae857534b83ca217f27447b4 parent 4907a07e219f055b093604f2f681c8597db8ad49
merb-more / merb-action-args
| name | age | message | |
|---|---|---|---|
| .. | |||
| |
LICENSE | Wed Feb 06 17:34:05 -0800 2008 | [Yehuda Katz] |
| |
README | Wed Feb 06 17:34:05 -0800 2008 | [Yehuda Katz] |
| |
Rakefile | Thu Feb 07 01:59:24 -0800 2008 | [ezmobius] |
| |
TODO | Wed Feb 06 17:34:05 -0800 2008 | [Yehuda Katz] |
| |
lib/ | Thu Feb 07 02:14:50 -0800 2008 | [ezmobius] |
| |
spec/ | Wed Feb 06 17:34:05 -0800 2008 | [Yehuda Katz] |
README
merb-action-args
================
A plugin for the Merb framework that provides support for arguments to actions that
come in from the query.
==== Basics
{{[
class Foo < Merb::Controller
def bar(baz)
bar
end
end
]}}
Hitting "/foo/bar?baz=bat" will call foo("bat").
Hitting "/foo/bar" will raise a BadRequest (Status 400) error.
==== Defaults
{{[
class Foo < Merb::Controller
def bar(baz, bat = "hola")
"#{baz} #{bat}"
end
end
]}}
Hitting "/foo/bar?baz=bat" will call foo("bat", "hola")
Hitting "/foo/bar?baz=bat&bat=whaa" will call foo("bat", "whaa")
Hitting "/foo/bar" will still raise a BadRequest.
==== Out of order defaults
{{[
class Foo < Merb::Controller
def bar(one, two = "dos", three = "tres")
"#{one} #{two} #{three}"
end
end
]}}
The interesting thing here is that hitting "/foo/bar?one=uno&three=three" will call
foo("uno", "dos", "three"). In other words, the defaults can be in any order, and
merb-action-args will figure out where to fill in the holes.




