Filip Jerga
Joined
40 Experience
0 Lessons Completed
0 Questions Solved
Activity
Check my comment above, or watch video more furthure. Reason is becasue you have no css in your javascript files. You can remove pack tags and add them after you add some vue code. Just follow tutorial
or update rails so far I checked this line is Ok in new rails-ujs
Heya Brenden I hope you managed to fix this issue. I was inspeting rails-ujs code and I had same issue. It was because of this line in rails-ujs
if (!(typeof options.beforeSend === "function" ? options.beforeSend(xhr, options) : void 0)) {
return false;
}
if (xhr.readyState === XMLHttpRequest.OPENED) {
return xhr.send(options.data);
}
so it couldnt get to send request because when you dont specify "beforeSend" it always return from function.
One possible way is to add:
Rails.ajax({
url: "/cards",
type: "POST",
data: data,
dataType: "json",
beforeSend: function() { return true },
.....
But i dont like t very much, you can install rails-ujs as module or use ajax of jquery and it should work.
if (!(typeof options.beforeSend === "function" ? options.beforeSend(xhr, options) : void 0)) {
return false;
}
if (xhr.readyState === XMLHttpRequest.OPENED) {
return xhr.send(options.data);
}
so it couldnt get to send request because when you dont specify "beforeSend" it always return from function.
One possible way is to add:
Rails.ajax({
url: "/cards",
type: "POST",
data: data,
dataType: "json",
beforeSend: function() { return true },
.....
But i dont like t very much, you can install rails-ujs as module or use ajax of jquery and it should work.
Hey Larry
Do you have still issue ? Its because webpack compiling no css...
Check file in "app/javascript/packs/application.js" - initialy you have there just console log. So webpack will compile no css.
Lets add this line "import App from '../app.vue'" and then run in terminal "bin/webpack" , aplication css should be generated
Do you have still issue ? Its because webpack compiling no css...
Check file in "app/javascript/packs/application.js" - initialy you have there just console log. So webpack will compile no css.
Lets add this line "import App from '../app.vue'" and then run in terminal "bin/webpack" , aplication css should be generated