Hello, My app is available in 2 languages, English (en) and French (fr). *I would like all my URLs to look like this :* /fr/companies /en/companies *I''ve setup this route :* map.connect '':lg/:controller/:action/:id'' I don''t want to specify the :lg parameter in every url_for calls. The language remains the same unless the params[:change_lg] is set. *In my application.rb, I''ve written this :* def default_url_options(options) { :lg => params[:change_lg].nil? ? session[:language] : params[:change_lg] } end *My problem :* When I use <?=companies_path ?> in my view, here is the URL that is generated : /companies?lg=en *What I would like to have instead :* /en/companies Has anyone an idea? Would be much appreciated. Thanks in advance, Thomas. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
you need to implement clean url that can be handled using a plugin from agile or u can also do it with the routes but then if there r many such links then its better to use plugin in routes u need to write the controller:theaction which performs that task and then the variable something like '':controller/:action/:id'' hope this helps -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Are you talking about a plugin I can find here http://agilewebdevelopment.com ?Which one are you talking about? On 9/7/07, Dhaval Parikh <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > you need to implement clean url that can be handled using a plugin from > agile or u can also do it with the routes but then if there r many such > links then its better to use plugin > > in routes u need to write the controller:theaction which performs that > task and then the variable something like '':controller/:action/:id'' > > hope this helps > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, did you find a solution for this? Cheers, derkaan Thomas Balthazar wrote:> Are you talking about a plugin I can find here > http://agilewebdevelopment.com ?Which one are you talking about?-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Apparently Analagous Threads
- link_to_remote > in :action , interrupt ajax to render a new page outside the :update div ?
- Unable to set default_url_options[:host] for Action Mailer
- default_url_options
- default_url_options for relative tag URLs
- Why doesn''t default_url_options :anchor => ... work for render