Implementing button gerar modelo, install gem prawn, create migration for add column modelo_id to processo and make relationship. Change processo controller and yours views and views modelo too. Add 2 routes for modelo individual and modelo coletivo. And create 2 functions in the processo controller, modeloindividual and modelocoletivo. Create too a diretory pdfs and create 2 class, modelo_individual.rb and modelo_coletivo.rb, both are responsible for generate the pdf dinamically and the comunication with view modelo. And make others small issues. Note: Yet dont working 100%, take easy, maybe I finish today :)