ruby on rails - Multiple Views Same Model -
i have course model goes controller , views in restful way.
for course show, featured. want course show have simplify page , original course show.
how can implement this? want restful, in controller there should show, update, index, etc.
should create controller have different name model? e.g. course2?
if admin view vs. public view, have entirely different namespaces 2 different restful controllers. or if think you're going have summary vs. full view thing lot, create namespaces based on distinction.
another option encoded differences in single erb template. or have show action render different templates same action using conditional logic.
without more context though, can't what's best option. against creating non-restful actions unless it's going one-off thing. non-restful actions tend out of hand in experience , controllers can ugly , unintuitive.
Comments
Post a Comment