route with optional parameter

30 views
Skip to first unread message

Stijnster

unread,
Jan 12, 2011, 11:12:37 AM1/12/11
to I18n Routing
Hi,


I have a named route with an optional parameter.


match 'all_jobs(/p-:page)' => 'browse#jobs', :as
=> :all_jobs, :constraints => { :page => /\d+/}

I've already tried a few combinations of translation keys, but I can
't seem to get it to work.

Is there a way to make the route available for translation, and if so,
what 's the best way?


Best regards,


Stijn

Stijnster

unread,
Jan 12, 2011, 11:45:50 AM1/12/11
to I18n Routing
Why do I always find the solution right after I've made a post?

It seems I can use this in my translations;

named_routes_path:
'all_jobs(/p-:page)': 'alle-oprdachten(/p-:page)'

If anyone has a better idea, please let me know.


Best regards,


Stijn

Kwi

unread,
Jan 12, 2011, 1:15:55 PM1/12/11
to I18n Routing
Hi Stijnster

Yeah !
Long time I haven't play with my gem, but yes, I think you just found
the right solution !

Best,
Guillaume
Reply all
Reply to author
Forward
0 new messages