I fully suspect that I'm missing the point here somewhere so I promise
I won't be offended if you tell me I'm being daft.
My application rents equipment ... not equipments. So I have the
following:
map.resources :equipment, :singular => :equipment_instance
class Equipment < ActiveRecord::Base
class EquipmentController < ApplicationController
The problem comes in my _form.haml partial that is used by new.haml
and edit.haml:
- form_for @equipment do |f|
This gives me an error saying "Only get and post requests are allowed.
(ActionController::MethodNotAllowed)"
I tried:
- form_for @equipment, equipment_instance_path(@equipment) do |f|
That gives the same error.
There has to be something better than:
- form_for @equipment, :url => (@equipment.new_record? ?
equipment_path : equipment_instance_path(@equipment)), :html =>
(@equipment.new_record? ? { :method => :post } : { :method => :put })
do |f|
Why does Rails not introspect correctly in this case?
Bryan
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---