1

I have a couple of resources, a grant_application, and a household which are related with a has_one

class GrantApplication < ActiveRecord::Base
  has_one :household, :dependent => :destroy 
end

class Household < ActiveRecord::Base
  belongs_to :grant_application
end

..and I also use the following route..

map.resources :grant_applications do |grant|
  grant.resource :household
end

However, I am having real problems when trying to create the form for /grant_applications/1/household/new

Using

<% form_for([:grant_application, @household]) do |f| %>

returns an error:

undefined method 'grant_households_path' for #<ActionView::Base:0x23eda44>

Any ideas?

1 Answer 1

0
<% form_for(@household, :url => grant_application_household_path(@grant) ) do |f| %>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.