Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def create
- if @offer.editable? && @offer.revisionable?
- @offer_revision = @offer.revisions.build(params[:offer_revision].merge(:uploaded => false))
- if @offer_revision.save_and_generate_document
- flash[:notice] = 'Revisión generada correctamente.'
- else
- render :action => 'new' and return
- end
- else
- flash[:notice] = 'No se puede crear una revisión nueva.' unless @offer.editable?
- flash[:notice] = 'La oferta no está completamente definida, revisar variables.' unless @offer.revisionable?
- end
- redirect_to offers_url
- end
Add Comment
Please, Sign In to add comment