views:

67

answers:

2

Im having a little trouble setting up routes.

I have a 'users' controller/model/views set up restfully

so users is set up to be a resource in my routes.

I want to change that to be 'usuarios' instead cause the app will be made for spanish speaking region... the reason the user model is in english is cause I was following the authlogic set up and wasnt sure if naming the model usuario instead would create trouble.. so basically this is what I have in mr routes.rb to get this functionality done.

map.resources :usuarios,:controller=>"users", :path_names => {:edit => 'editar' }

the problem is that when I try to register a new user I get this error

 ActionController::MethodNotAllowed

Only get, put, and delete requests are allowed.

this happens after I have filled out my register form and clicked on submit...

+3  A: 

Have you tried using the 'as' option to change how the url looks without modifying the routes? This example is from the documentation:

# products_path == '/productos'
  map.resources :products, :as => 'productos' do |product|
    # product_reviews_path(product) == '/productos/1234/comentarios'
    product.resources :product_reviews, :as => 'comentarios'
  end
Jeff Paquette
A: 

You can try rake routes | grep usuarios from a terminal window (cd to the project root first) to make sure that the proper named routes are setup properly. You can cross reference that with the form tag you are using to make sure that the action for the form is correct.

Thomas Brice