prefixed route splats?

12 views
Skip to first unread message

trans

unread,
Jun 23, 2012, 5:26:52 AM6/23/12
to sina...@googlegroups.com
Can Sinatra handle routes with partial letters in the splats, eg. in this case a prefixed `v`:

  # example call: /v1.0.0/rss.xml
  get '/v*/rss.xml' do
    params[:splat]     #=> ['1.0.0']



Carl Hörberg

unread,
Jun 23, 2012, 9:33:08 AM6/23/12
to sina...@googlegroups.com
use regex instead: get %r{/(.*)/rss.xml}
> --
> You received this message because you are subscribed to the Google Groups
> "sinatrarb" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sinatrarb/-/KW_8slPkjAIJ.
> To post to this group, send email to sina...@googlegroups.com.
> To unsubscribe from this group, send email to
> sinatrarb+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/sinatrarb?hl=en.
Reply all
Reply to author
Forward
0 new messages