ruby on rails - Routing for model that has an association from another module -
i'm trying figure out problem i'm having generating paths, , need put in routes file.
at moment have following:
class car has_many :doors, class_name: 'cars::door' end module cars class door end end
when attempting render simple form door, i.e
simple_form [@car, @car.doors.build]
i following error
undefined method 'car_cars_doors_path'
the above pseudo code, forgive typos. can tell me need put in routes.rb fix this?
since car model scoped under module cars, don't have scope again car object in simple form
simple_form_for @car.doors.build
this generate path cars_doors_path
. if need car_doors_path, have specify explicitly
simple_for_for @car.doors.build, :url => car_doors_path
Comments
Post a Comment