Ruby on rails: singular resource and form_for

Unfortunately, this is a bug. You’ll have to set the url like you mention. = form_for @order, :url => order_path do |f| Note that this will properly route to create or update depending on whether @order is persisted. Update There’s another option now. You can add this to your routes config: resolve(“Order”) { [:order] } … Read more

form_for with nested resources

Travis R is correct. (I wish I could upvote ya.) I just got this working myself. With these routes: resources :articles do resources :comments end You get paths like: /articles/42 /articles/42/comments/99 routed to controllers at app/controllers/articles_controller.rb app/controllers/comments_controller.rb just as it says at http://guides.rubyonrails.org/routing.html#nested-resources, with no special namespaces. But partials and forms become tricky. Note the … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)