David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
Ruby Rogues Panelist
David Kimura PRO said about 7 years ago on Single Table Inheritance :

This is common and typically due to the validation failure handling of 

render :new

Have a look at https://stackoverflow.com/a/41520362/722274

One way around this is to do client side validations which I have an example of this at https://www.driftingruby.com/episodes/client-side-validations


David Kimura PRO said about 7 years ago on Page Specific Javascript in Ruby on Rails :

You could mix and match based on the complexity of the JS needed. You could also look at something like client side validations to prevent the form from posting if the data isn’t valid (but not recommended for uniqueness validations because of potential security reasons).


David Kimura PRO said almost 7 years ago on FullCalendar Events and Scheduling :

Are you receiving any JavaScript errors in the browser?


David Kimura PRO said almost 7 years ago on Additional Dependencies in Beanstalk :

A tip for using Beanstalk Enhanced Health monitoring instead of Basic Health:

For Drifting Ruby's Production environment, my nginx.config looks like this. Take note that the file is not /etc/nginx/conf.d/proxy.conf, but rather /etc/nginx/conf.d/webapp_healthd.conf. This is because we are overwriting the existing default webapp_healthd.conf that beanstalk creates a symlink for. If you do have existing instances with the older proxy.conf, it could create a conflict since we're listening on port 80.

files:
  /etc/nginx/conf.d/webapp_healthd.conf:
    content: |
      client_max_body_size 500M;
      server_names_hash_bucket_size 128;
      upstream backend {
        server unix:///var/run/puma/my_app.sock;
      }
      log_format healthd '$msec"$uri"'
                      '$status"$request_time"$upstream_response_time"'
                      '$http_x_forwarded_for';
      server {
        listen 80;
        server_name _ localhost;
        if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})T(\d{2})") {
          set $year $1;
          set $month $2;
          set $day $3;
          set $hour $4;
        }
        access_log /var/log/nginx/access.log main;
        access_log /var/log/nginx/healthd/application.log.$year-$month-$day-$hour healthd;
        error_log /var/log/nginx/error.log;
        large_client_header_buffers 8 32k;
        root /var/app/current/public;
        location / {
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_set_header X-NginX-Proxy true;
          proxy_buffers 8 32k;
          proxy_buffer_size 64k;
          proxy_pass http://backend;
          proxy_redirect off;
          # enables WS support
          location /cable {
            proxy_pass http://backend;
            proxy_http_version 1.1;
            proxy_set_header Upgrade "websocket";
            proxy_set_header Connection "Upgrade";
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          }
        }
        
        location /assets {
          alias /var/app/current/public/assets;
          gzip_static on;
          gzip on;
          expires max;
          add_header Cache-Control public;
        }
        location /public {
          alias /var/app/current/public;
          gzip_static on;
          gzip on;
          expires max;
          add_header Cache-Control public;
        }
      }

container_commands:
  01restart_nginx:
    command: "service nginx restart"

David Kimura PRO said almost 7 years ago on Virtual Columns with JSON Data Types :

With MariaDB, it looks like the JSON data type was introduced in 10.2.7. However, instead of a JSON data type, it creates a LONGTEXT.

https://mariadb.com/kb/en/library/json-data-type/