Skip to content
This repository was archived by the owner on Oct 1, 2019. It is now read-only.

Fix file assets#7

Open
johnyb wants to merge 11 commits intomasterfrom
fix_file_assets
Open

Fix file assets#7
johnyb wants to merge 11 commits intomasterfrom
fix_file_assets

Conversation

@johnyb
Copy link
Member

@johnyb johnyb commented Oct 28, 2012

this is the work to fix #1

@johnyb
Copy link
Member Author

johnyb commented Nov 12, 2012

Hey @Sinthoras, see ffec797 of how to fix the problem, we discussed in irc earlier today! :)

All the file_asset forms need a bit of styling, though. @Sinthoras, mind to care about this?

This should be all that is needed for the wikipedia integration. It’s
now possible to search for new images and add them as FileAsset records.
This is mostly a rewrite of the old code and is IMHO much more clean and
more tested.
Wikipedia::Page.image_urls returns nil, if no results are found. But we
want to assign an empty list in this case. This allows the partials to
be rendered properly.
calling find with an empty string will raise a TypeError, so we need to
check for it.
wasn’t loaded in manifest file, before
There is now a gem for this thing, done by Tors Dalid. Thanks to him for
creating it :)

See [1](https://github.com/tors/jquery-fileupload-rails) for more
information.
Not needed any longer. File upload is horribly broken, so I throw out
most things related and implement it more easy from scratch
All this stuff isn’t needed, for now. May be it can be re-added, when we
want to support mass-import of files. But I don’t see that feature right
now.
This brings some changes to make file-upload work much better because it
uses rails form helpers instead of some self-hacked stuff. Should be a
much better approach, now.
* remove jquery.fileupload stuff, this isn’t needed any longer
* add some styling
We should make it work without this, before integrating all this again.
I don’t know if it’s worth the effort to keep this dependency. May be,
plain file-upload just does the trick for us.
To allow the form builder code to add the multipart option to the form,
the file input field must be created using the original form object.
This propagates the form object into the local_file_form partial and
makes use of it to create the field.

Makes file upload finally work again.
@johnyb
Copy link
Member Author

johnyb commented Nov 12, 2012

I cherry-picked a few commits into master, already, because they have nothing to do with this pull request. I also did a rebase, so some hashes changed. Remember to do a git reset --hard origin/fix_file_assets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix update/create actions for FileAssetsController

1 participant