Jiri Prochazka

Joined

160 Experience
0 Lessons Completed
0 Questions Solved

Activity

I have an Ubuntu 18.04 server with Nginx and Phusion Passenger (non-Rails app) and it is working for websites with ASCII characters in HTML only.

But when I put a non-ascii character to the index.erb like รก for example, I get error:
Incomplete response received from application

My locale is:

LANG=C.UTF-8
LANGUAGE=C.UTF-8
LC_CTYPE="C.UTF-8"
LC_NUMERIC="C.UTF-8"
LC_TIME="C.UTF-8"
LC_COLLATE="C.UTF-8"
LC_MONETARY="C.UTF-8"
LC_MESSAGES="C.UTF-8"
LC_PAPER="C.UTF-8"
LC_NAME="C.UTF-8"
LC_ADDRESS="C.UTF-8"
LC_TELEPHONE="C.UTF-8"
LC_MEASUREMENT="C.UTF-8"
LC_IDENTIFICATION="C.UTF-8"
LC_ALL=C.UTF-8

All files are in UTF-8 as well, of course.

Any ideas? I'm out of mine already..

Thanks

Ok, I just tried with Rails 5.1.4 and it is working. So it is something with 5.2.0.rc1..
Hi,

I'm trying to use Knock as in episode #165 API Authentication with JSON Web Tokens (JWT) and Knock.

I'm going step by step, but when trying to obtain the token by:

curl --data "auth[email]=myemail@gmail.com&auth[password]=pass" http://localhost:3000/api/v1/user_token

I'm getting 'Unprocessabel entity' and in my log there is 'Can't verify CSRF token authenticity. Completed 500 Internal Server Error in 96ms'

But at the start I have created a brand new project with --api flag. I created the project twice to be sure (5.2.0.rc1).
Should not the rails new backend --api generate a project without CSRF?

Thanks

Posted in Modern Webpack template on Rails 5.1

I have downloaded this Adminator template, which is modern npm/yarn Webpack theme. As stated in the template's homepage, install instructions are:

> git clone https://github.com/puikinsh/Adminator-admin-dashboard.git adminator
> cd adminator
> npm install
> npm run dev

And it is working like a charm.

Now my question is, how can I implement it to Rails 5.1+? Should I use webpack support when creating a new app:

> rails new myapp --webpack

Template contains a folder assets should that whole folder to app/javascript/pack and run npm install to install node_modules?

But those are not any components, I think it should be rather placed in /vendors folder, right?

Thank you