...option -p tells thin to bind to port 3001. To have a http development server running at the same time, start it with thin start -p 3000. (To run your...
...sql mode in the config/database.yml (and that of all your colleagues, staging and production servers!): development: adapter: mysql2 ... variables: sql_mode: TRADITIONAL (Be aware, that this solution disables the only...
Here is a Javascript function reloadUsers() that fetches a HTML snippet from the server using AJAX and replaces the current .users container in the DOM: window.reloadUsers = -> $.get('/users').then (html...
...some DOM-related matchers like haveText(...). See Jasmine: Mocking API requests in an Angular service spec on how to do similar things in an Angular application...
When a has_many association basically serves to store a list of associated strings (tags, categories, ...), it can be convenient to represent this association as a string array in the...
To avoid this in the future, make sure everybody installs gems on remote servers properly by using the install-gems-remotely command from our geordi gem.\
...couldn't set cookies with any browser at all. Solutions Use a dns wildcard service like lvh.me and set :domain => 'lvh.me' if Rails.env.development? Then you can access your local server...
...send a local file to the browser, you can save resources on the application server by setting the :x_sendfile option to true. This option is activated by default for...
...request. This way code changes take effect immediately, without requiring you to restart the server. If you have been working with Rails for a while, you might even have forgotten...
...themselves from disk. Production All files are loaded in a deterministic order once the server boots. Take this example with some constants referencing each other: # app/models/contract/document/uploader.rb class Contract::Document::Uploader...
...format and extend the input with ajax options. You should paginate your results on server side to reduce the load. Select2 supports an "infinite scroll" feature, which will be enabled...
This tool is used on our application servers (and called when deploying) but it also works locally. Just call dumple development from your project directory to dump your database.
...that is older than mine. Every time I wanted to run my rails dev server I was asked to check my yarn integrity: error Integrity check failed
Then run bundle install (and don't forget to restart your development server.) Usage This is a common example for graph generation in Rails. Note that you have...
...language when they visit the root path. Here is how to do it without a server-side component (like a Rails application). Use JavaScript's navigator.language (real browsers and IE11...
...connection usually takes only a few seconds, but if you’re connecting to a server multiple times in succession the overhead starts to add up. If you do a lot...
...of Git pushing and pulling or frequently need to SSH to a dev server, you’ve probably felt the pain of waiting for SSH to connect so you can get...
As we get ready to upgrade our servers I thought it’d be a good time to upgrade our deployment process. Currently pushing out a new version of GitHub takes...
...upwards of 15 minutes. Ouch. My goal: one minute deploys (excluding server restart time...
...plugin for Ruby on Rails aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client. In other words your app can...
...have a real time connection to the server with the advantage of instant updates...
We recently decided our CI server needed an overhaul. I really enjoyed Integrity as a build server, but after trying out Hudson it’s hard to say I want to...
You are not using javascript tests The file is served from a public folder (not via controller) Problem description If you deliver files from a public folder it might...
...content-type "..." Outline How to test file downloads with tests that need javascript. Public served Look at the link of the url and check if this file exists in your...
We have often felt the pain where our models need to serve too many masters. E.g. we are adding a lot of logic and callbacks for a particular form screen...
...that can be both leaves and containers of other items has_ancestry on the server side Things I learned: Be ready to write a lot of CSS. You need to...
When talking to your MySQL server via a mysql shell, you can terminate queries by ; or \G -- the latter gives you a vertical output. You know this: mysql> SELECT * FROM...
...the bucket as private and fetch the appropriate files from S3 to your application server and stream them to the client finally. While this is possible, I'd recommend to...
...your_model.document.expiring_url => "http://s3-eu-west-1.amazonaws.com/your-bucket/files/foo/bar/123/456/ab/cd/1/2/3/original/Attachment.pdf?AWSAccessKeyId=ABSJASHJK232JAHBS&Signature=V6aJhal2kaB4bxKal23lSMV%2F9w%3D&Expires=1347889426" The expiring_url method carries out a web service call to S3 to gain the data for AWSAccessKeyId and Signature being used within the URL...
...utilize the respective hostnames of you machines. For example, if you have 8 application servers (e.g. app1.example.com, app2.example.com, ...) and want to enable NewRelic on app1 and app2 only, utilize those...
...to remove an element from it, after you've successfully deleted it from the server. The README suggests to say something like $scope.users = _.without($scope.users, user). While that works at...