Commit Graph

15 Commits

Author SHA1 Message Date
Javi Martín
7212657c02 Remove Paperclip and use just Active Storage 2022-02-23 18:43:48 +01:00
Javi Martín
091abfc944 Use Active Storage to render attachments
This way we fix a bug we mentioned in commit 930bb753c which caused
links to documents to be broken when editing their title because the
title was used to generate the URL of the document.

Note we're still using Paperclip to render cached attachments because
this is the only case where we store files with just Paperclip and not
Active Storage.

With Active Storage, we render attachments just like any other resource,
using `polymorphic_path`. Paperclip included the `url` method in the
model; since the model doesn't have access to the request parameters
(like the host), this was inconvenient because it wasn't possible to
generate absolute URLs with Paperclip.

In order to simplify the code and make it similar to the way we used
Paperclip, we're adding a `variant` method accepting the name of a
variant and returning the variant.
2022-02-23 18:21:38 +01:00
Javi Martín
c62da726b8 Apply SpaceAroundErbTag ERB Lint rule 2019-09-10 20:02:15 +02:00
rgarcia
dacc2d529d Fix destroy document specs
We were linking to the document url itself, which does not have a route
associated and so the specs fails

With this commit we are using the correct path to the destroy action of
the DocumentsController.

We are also using the referrer instead of a params[:from] attribute, as
it avoids having to pass an extra parameter, making the code prettier
and it works the same way
2019-01-24 21:39:43 +01:00
decabeza
5c0a10699a Refactors documents partials and reorganices css 2018-02-28 15:22:33 +01:00
Bertocq
97ec551178 Correctly check if user can destroy a document 2018-01-24 17:07:05 +01:00
Bertocq
d7d1a85fbb Refactor documents and document view partials 2018-01-02 13:32:42 +01:00
Senén Rodero Rodríguez
cc89907bff Add nested documents to proposal form. 2017-08-25 18:34:52 +02:00
Senén Rodero Rodríguez
c438e510c0 Add rel attribute with nofollow value. 2017-08-25 18:34:51 +02:00
Senén Rodero Rodríguez
17ad148cd7 Fix i18n translations warnings. 2017-08-25 18:34:50 +02:00
Alessandro Cuoghi
63621aa526 Style radio buttons. Added icon inside the table. Adjusted buttons with the same width. Changed position buttons in responsive. Pass scss-lint. 2017-08-25 18:34:50 +02:00
Senén Rodero Rodríguez
3a7c9d9f83 Add documentables helper 2017-08-25 18:34:49 +02:00
Alessandro Cuoghi
62372aaee3 Added translation buttons download, destroy, link. Remove white space. 2017-08-25 17:27:37 +02:00
Alessandro Cuoghi
27b3c60e92 Added style button download and remove. Removed border on table. 2017-08-25 17:27:37 +02:00
Senén Rodero Rodríguez
a2130689ed Create documentable concern and add it to budget investment model. Create documents controller, documents helper, routes, translations and specs 2017-08-25 17:27:37 +02:00