-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Attachments are optional, but Rails 5.1 doesn't know that #246
Comments
Thanks for the report @walterdavis. We are currently working on Rails 5.1 support, but with it's recent deprecations are finding it difficult to support both Rails 4 and 5.1. If you want to work with a stable version of Fae I'd recommend using Rails 5.0 for now. |
Hi, I also need attachments to work with Rails 5.1. EDIT: see below for a better way I tried to override
It seems to fix the issue, but breaks the scaffold generator:
Can you help? @jamesmk let me know if there anything I can do to help with Rails 5.1 support. |
I need to get Fae to work with Rails 5.1 (especially attachments) in the coming weeks. @jamesmk please let me know how I can help, I can spend some time on this. |
@Spone Rails 5.1 support will be rolled into Fae 2.0 due to the difficulty of supporting Rails 4 and 5.1 in the same engine. 2.0 will be on a longer timeline as there's lots we want to improve. We'd appreciate any help with the Rails 5.1 support and will accept PRs into the I think you're on the right path with your solution above. The error you're getting was likely fixed by your recently merge PR: #282 thanks |
@jamesmk Thanks for getting back to me. The solution described below fixes the issue. Regarding Fae 2.0, do you mind if I add feature suggestions as issues, so we can discuss them and maybe include them in v2.0? Then I may be able to spend time on some of them. |
@Spone Feature requests are welcome! |
Quick follow-up on overriding the classes: it's easier to put them in their own files and take advantage of built-in Rails overriding logic (instead of adding an initializer). So I'd advise creating these files in your app: app/models/fae/file.rb
app/models/fae/image.rb
|
refs #246 - make polymorphic assets optional as required by Rails 5.1+
I tried using the latest release of fae on Rails 5.1 (Ruby 2.3.1). I was able to work around the copied generators error, but then could not create a new Article (following the example in the quick start). I traced this to the Hero Image and PDF being (implicitly) required at the model layer, but not in the UI. Overriding the Fae::File with
...and similar on the Fae::Image allowed the interface to work.
There was an additional oddity with the UX in the form, related (I suspect) to the system marking these form elements as not required. After submitting the form, I would briefly see an error message at the top saying that I should "check the form fields for errors". This would disappear after a very short time, but no fields were marked as having errors. When I added
= debug @item.errors.full_messages
to the relevant _form partial, I was able to see that the image and file were being required, as noted above.The text was updated successfully, but these errors were encountered: