ruby on rails - Better way to make nested resources? -
in routes.rb
have following code create nested paths students
, subjects
under student_groups
:
resources :student_groups resources :students, :subjects end
i want nest goals
under subjects
without generating new routes subjects
along nested routes goals
. i've done via following (plus appropriate stub
action in subject_controller
):
resources :subjects, :only => :stub resources :goals end
this works fine - have functionality of goals
being nested under subjects
without routes generated if didn't use stub.
edit: question this: there better/less hack-y way in rails?
Comments
Post a Comment