Also, if you wanted to stick to the REST actions in your controllers, you could have a separate controller (with no additional model): think TutorsController and MultipleTutorsController or something like that. Rails conditions you to think that a controller must be unique to its model, but controllers don't even need models if that's not what they are doing, and multiple controllers can help refine your routing around a single model -- think a ContentsController and an AdminContentsController, with the same Content model.
Walter
> On Jun 28, 2018, at 3:17 AM, Colin Law <clanlaw@gmail.com> wrote:
>
> On 28 June 2018 at 05:37, Julian Medina <julian.l.medina@gmail.com> wrote:
>> Hello:
>>
>> I have an interesting yet somewhat strange task. Currently, there is a form
>> in my app which adds just single record for certifying tutors. The group
>> wants a way for volume purchasing where a coordinator can login and add
>> multiple tutors in one form. I was considering a nested form or form object
>> but since the certificate actually follows the individual instead of
>> coordinator, I am now thinking it is best if multiple records under the
>> "Certifcation" model get created under a single form. I really don't see why
>> I'd need an entirely separate model for this. Would I need to implement a
>> "hacky" solution for this?
>
> Remember you can have multiple actions on a controller which bring up
> different forms. So you can have a separate action that brings up the
> multi-record form.
>
> Colin
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtz4W9oRvtUiKkdx8cMPnV1zqLN%3DpkOgUMQveTbY4JZYw%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/6CF88F4E-158B-4D45-8A81-F2EC8EBA5161%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment