Playing with routes Rails 2.3

Okay, I’m just getting back into using Rails for a few private projects
am trying to stick to the RESTful way of doing things.

If I have a teacher model and a lesson model, the basic scaffold setup
create these items is fine. But then I have the relationship that a
habtm lessons and a lesson habtm teachers.

The logical place to implement that is in the teachers_controller but
like to know the best route to make.

I’ve added this to my config/routes.rb …

map.resources :teachers, :member => { :new_teacher_pool => :get,

:create_teacher_pool => :post}

which allows me URLs like teacher/1/new_teacher_pool and
/teacher/1/create_teacher_pool but I don’t know if I should just be
the default controller and use a URL such as /teacher/new_pool/1 and
/teacher/create_pool/1(posted pool_id(s)) etc.

What’s the best way to approach this?

Thanks in advance


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs