Uploading files inside the WYSIWYG editor uploads to froala server


(Erlingur) #1

Uploading images straight from the WYSIWIG editor works fine, uploads to your media folder. However, uploading a file using the editor uploads to i.froala.com. I believe the issue is missing configuration settings as per: https://froala.com/wysiwyg-editor/docs/concepts/file/upload


(Aaron Russell) #2

Thanks for reporting this @erlingur - I’ve just released a new version that fixes this issue. Hope no-one’s been accidentally uploading stuff there :worried:

Use version 0.9.3 for the fix.

The commit for reference:


(Erlingur) #3

Awesome, thank you! :slight_smile:

On a sidenote, I cloned pushtype onto my system and pointed my Gemfile to the local version of the gem for development purposes and had some issues getting started. It seems that there are some dependency issues in the package.json file, specifically with vue-loader. I had to run npm install --save vue vue-loader vue-html-loader css-loader style-loader babel-loader babel-core babel-plugin-transform-runtime babel-preset-es2015 babel-runtime vue-hot-reload-api (a command I got from Googling, I’m sure there’s some stuff I don’t need here) and then fix the package.json file, changing vue-loader to "vue-loader": "^8.5.4" to get it to work.

I’m pretty new to npm and webpack and vue and these things so I’m not sure if what I did was optimal but it worked. Could you possibly take a look at this? Maybe clone a fresh copy of push_type and set it up with a fresh copy of rails, like someone new coming to this project would, and post the steps needed to get a development environment running?

Something like this, doesn’t have to be complicated:

  1. Clone push_type
  2. Run npm install inside the admin directory
  3. Run ./node_modules/.bin/webpack --config config/webpack.config.js inside the admin directory

(This is roughly what I did, after mucking about with npm and package.json).

Thanks! :slight_smile:

PS. Really digging PushType! I think it could be one of the best Rails CMS! VERY easy to get a basic site up and running and coding “around” it :slight_smile:


(Aaron Russell) #4

Ah yes, that does need to be documented. Although you basically got there in the end:

  1. cd admin
  2. npm install
  3. rake webpack - (there is a rake task that executes webpack for you)

I’ll take a look at the dependencies and make sure package.json is up to date.

It’s not ideal that I’ve had to shoehorn webpack in like that. I wish Rails handled front end dev in a more flexible way (like how Phoenix allows you to use any front end build tools).

Cool :smiley: this is exactly what I’m trying to do. Make it easy for beginners to get basic sites up and running in Rails, and then learn how Rails can be used to turn those basic sites into more ambitious things. The project definitely needs more polish - and I’m sure there’s more bugs like the one you’ve discovered above - but I think the underlying model is right.


(Erlingur) #5

but I think the underlying model is right.

Absolutely! PushType takes enough of the “drudgery” away while still being easy to implement your own stuff. Love it!

Yeah, there’s definitely something up with the deps in package.json. Doing a clean clone and running rake webpack gives me:

Hash: 64f798ae64f342b8510d
Version: webpack 1.13.2
Time: 1773ms
          Asset     Size  Chunks             Chunk Names
admin.bundle.js  1.69 MB       0  [emitted]  admin
    + 137 hidden modules

ERROR in ./app/webpack/javascripts/components/asset-modal.vue
Module build failed: TypeError: this._init is not a function
    at Object.Vue (/Users/eth/Projects/testing/push_type/admin/node_modules/vue/dist/vue.common.js:9674:8)
 @ ./app/webpack/javascripts/components/asset-field.es6 11:18-46

I fixed this with the stuff I wrote in my previous post.