How to initialize an Array of Hashes in Ruby
How to initialize an array of hashes. Each value of keys within the hash will initially consist of an empty array: your_hash = Hash.new {|h,k| h[k] = [] }
How to initialize an array of hashes. Each value of keys within the hash will initially consist of an empty array: your_hash = Hash.new {|h,k| h[k] = [] }
Once you know the dimensions of the images (photos or graphics) you’re waiting your graphic designer or other developers to produce for you, instead of waiting for them to hand the final revisions of those images to you, you can use this free service Placehold.it Just put something like this in your HTML.
Wondering whether or not a website is running on rails? Check out Is it Rails? and let us know if the result was accurate for your site.
ActionMailer::Preview is pretty awesome and newly introduced in Rails 4.1+ It allows you to preview formatting of emails from within the browser without having to send emails just to be able to preview them in the email client. This substantially reduces the duration of each development cycle between coding and testing a modification. If you […]
If you’re using Rails, Nginx, Passenger and RVM or rbenv and wondering what to set the passenger_root and passenger_ruby paths to in nginx.conf, here’s how to get them. Keep in mind, you’ll have to do this by reconfiguring Nginx if you switch from RVM to rbenv or vice-versa. First you must install the passenger gem […]
To disable chef-client from init.d (be sure you really want to do this!) Then add something like this to your crontab:
If you are on a unix system and want to set up a crontab (cron job) and you are using RVM, you must make sure to make bash act as if it had been invoked as a login shell by using the bash -l option. So if you were going to have a script run […]
In order to modify the maximum Java Heap Size (or any other JAVA_OPTS) when using the TorqueBox gem, start torquebox by doing a: Look for the default JAVA_OPTS settings and set your JAVA_OPTS path. Be sure you aren’t overriding your current settings first. In my case, for TorqueBox 2.3.0, I wanted to modify the maximum […]
Type the following:
My goal is to push my rails app to Heroku. However, I wasn’t able to install the heroku gem. If you get the following error when trying to do a gem install herokuĀ –no-rdoc –no-ri After researching online there were two things that could potentially be the problem. The first is that there is that my […]