question marks in sinatra get method
I am trying to use a question mark in one of my url's but sinatra/ruby is interpreting it as the regex character that makes precedings optional. Is there any way to allow actual ? in your get开发者_C百科 methods? I have tried \? and [?] but they didn't work. Here is the begining of my get method:
get '/group?groupid=:groupId' do |id|
If I go to www.mydomain.com/group?groupid=1 I get an error but it works if I go to www.mydomain.com/groupgroupid=1
The "?" starts the querystring portion of the URL; querystring parameters are accessible via the "params" Hash.
精彩评论