views:

8

answers:

0

hi all

i have added internationalization to my site via domainname.com/en/etc

I have done this by adding to map.with_options(:path_prefix => ":locale") do |m| to wrap around all my resources in routes file.

I have added this to application_controller

before_filter :set_locale

def set_locale # if params[:locale] is nil then I18n.default_locale will be used I18n.locale = params[:locale] end

and also added this method to add it to all urls

def default_url_options(options = {}) { :locale => params[:locale] || "en" } end

I now need to state urls like this for it to work edit_page_path(:id => @page.url)

The problem is my form_for now dont work as they probably need this sort of format now as well ??

Is this correct ? if so how do i do this ? please show me examples if possible.

thanks alot rick