Displaying 2 results from an estimated 2 matches for "section_regexp".
2007 Jul 13
1
Regexp Question - Merb::Router
Hi,
I''m looking through the Merb::Routing code and I''ve found a regexp that I
can''t figure out how it works.
Merb::Router::SECTION_REGEXP #=> /(?::([a-z*_]+))/
It takes a route definition string, like "/products/:model/:id" and
extracts the "model" string on the first pass, and later the "id" string.
Can anyone shed some light on what the
?::
part does? I haven''t found it in any of the...
2007 Jul 19
3
Merb::Controller#url Usage
...ion"=>"1",
"created_at"=>"2007-07-18 21:38:08"}>
My expectation was that I would pass the object I want to evaluate to
the url method. This works when I use edit_article_attachment. (note
I added some debug puts statements in there before and after the
SECTION_REGEXP sub)
irb(main):005:0> url(:edit_article_attachment,attachment)
--path before: /articles/:article_id/article_attachments/:id/edit
--path after: /articles/1/article_attachments/1/edit
=> "/articles/1/article_attachments/1/edit"
However, when having a new form on the page, I ty...