I don't know what I'm doing wrong here. Have a many to many link setup per below. I believe I it setup correctly. I want to have the form to create a new material on the spaces page via the auto_actions_for command in the materials controller. The form isn't showing up but the route is added. If I manually navigate to the route (
http://localhost:3000/spaces/4-grade-k6-classroom/materials/new) I get the following error.
No reverse reflection for Material.space
app/views/taglibs/auto/rapid/forms.dryml:64:in `block in form__for_material'
app/views/taglibs/auto/rapid/forms.dryml:63:in `form__for_material'
app/views/taglibs/auto/rapid/pages.dryml:889:in `block (6 levels) in new_for_space_page__for_material'
app/views/taglibs/auto/rapid/pages.dryml:888:in `block (5 levels) in new_for_space_page__for_material'
app/views/taglibs/auto/rapid/pages.dryml:888:in `block (4 levels) in new_for_space_page__for_material'
app/views/taglibs/auto/rapid/pages.dryml:873:in `block (3 levels) in new_for_space_page__for_material'
app/views/taglibs/themes/clean/clean.dryml:2:in `block in page_with_aaa82d3a9ca5'
app/views/taglibs/themes/clean/clean.dryml:1:in `page_with_aaa82d3a9ca5'
app/views/taglibs/application.dryml:14:in `block in page_with_a77e028717a9'
app/views/taglibs/application.dryml:13:in `page_with_a77e028717a9'
app/views/taglibs/auto/rapid/pages.dryml:870:in `block in new_for_space_page__for_material'
app/views/taglibs/auto/rapid/pages.dryml:869:in `new_for_space_page__for_material'
app/views/taglibs/auto/rapid/pages.dryml:873:in `block in new_for_space_page'
app/views/taglibs/auto/rapid/pages.dryml:870:in `new_for_space_page'
Code:
class Material < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
name :string
quantity :float
timestamps
end
has_many :spaces, :through => :material_spaces, :accessible => :true
has_many :material_spaces, :dependent => :destroy
....
end
class Space < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
name :string
space_dwgid :string, :required, :index => true
description :text
dwg_x :float
dwg_y :float
timestamps
end
belongs_to :floor
has_many :materials, :through => :material_spaces, :accessible => :true
has_many :material_spaces, :dependent => :destroy
children :materials
...
end
class MaterialSpace < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
timestamps
end
belongs_to :material
belongs_to :space
...
end
class MaterialsController < ApplicationController
hobo_model_controller
auto_actions :all
auto_actions_for :spaces, :create
end