Mailinglist Archive: yast-devel (128 mails)

< Previous Next >
[yast-devel] WebYaST: Improved routing - dot is allowed in path :id now
  • From: Ladislav Slezak <lslezak@xxxxxxx>
  • Date: Wed, 03 Feb 2010 15:28:14 +0100
  • Message-id: <4B6987FE.8080005@xxxxxxx>

Hi,

I have slightly changed routing in WebYaST (in the both components).

The problem was that e.g. repositories/show/openSUSE-11.2.xml request was
parsed to
:id => "openSUSE-11", :format => "2". That obviously could not work properly.

It was fixed by specifying requirements for :id parsing:

In the service:
:requirements => {:id => /[^\/]*(?=\.html|\.xml|\.json)|.+/ }

In the client:
:requirements => {:id => /[^\/]*(?=\.html|\.js)|.+/ }


Now whole string is used for :id, if there is a predefined suffix it is
excluded from
the :id.

The regexps have to be modified if we need to support a new format in the
future.


(For more details about routing see:
http://guides.rubyonrails.org/routing.html
http://api.rubyonrails.org/classes/ActionController/Routing.html
http://zargony.com/2009/05/05/routing-parameters-with-a-dot )


--

Best Regards

Ladislav Slez√°k
Yast Developer
------------------------------------------------------------------------
SUSE LINUX, s.r.o. e-mail: lslezak@xxxxxxx
Lihovarsk√° 1060/12 tel: +420 284 028 960
190 00 Prague 9 fax: +420 284 028 951
Czech Republic http://www.suse.cz/
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-devel+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages