Posts

User Login And Logout Show Notice Box Massage

  Javascript/Application.js #rails6 require("lib/jquery.toast") javascript/lib/jquery.toast.js ; // jQuery toast plugin created by Kamran Ahmed copyright MIT license 2015 if ( typeof Object.create !== 'function' ) { Object.create = function( obj ) { function F() {} F.prototype = obj; return new F(); }; } (function( $, window, document, undefined ) { "use strict"; var Toast = { _positionClasses : ['bottom-left', 'bottom-right', 'top-right', 'top-left', 'bottom-center', 'top-center', 'mid-center'], _defaultIcons : ['success', 'error', 'info', 'warning'], init: function (options, elem) { this.prepareOptions(options, $.toast.options); this.process(); }, prepareOptions: function(options...

Add CORS to Nginx on AWS Elastic Beanstalk

Image
Apache Add the following block to your  .htaccess  file: <FilesMatch ".(eot|otf|ttf|woff|woff2)"> Header always set Access-Control-Allow-Origin "*" </FilesMatch> Nginx Add the following location block to your virtual host file (usually within the server directive) and reload Nginx: location ~* \.(eot|otf|ttf|woff|woff2)$ { add_header Access-Control-Allow-Origin *; } Invalidate CloudFront Distribution Once the changes have been made you will need to  invalidate the CloudFront cache  with a path of “/*”. Integrating to CloudFront service It’s simple to config and use CloudFront (a CDN service) for Rails app.  Just one thing from my experience, regarding to CORS issue on EB when your CSS want get loading font files or font-awesome. Because EB run your app with Nginx server serve public static files, then work around would be overwriting web server config in Nginx with  add_header Access-Cont...