Ruby has a very simple windows installer. http://rubyinstaller.org/downloads/ At the moment, stay with the 2.2 branch. But there is usually a comment on the right suggesting the best version.
So you want run some generic SQL in Ruby an a result – like the number of users sql = “select count(*) as amount from users” result = connection.execute(sql).fetch_row amount = result.to_f
When you call a partial in Rails, you pass through all of the local parameters. But how do you use an “optional” local – or add a new local without having to go back and add it to all the other views. > show\_closed = true unless defined?(show\_closed)
How to convert a string to Title Case Break into words Capitalise each word Join back together split(/(\W)/).map(&:capitalize).join or example “hello world”.split(/(\W)/).map(&:capitalize).join “Hello World” or s = “hello world”Title Case for Ruby Strings s.split(/(\W)/).map(&:capitalize).join Or from a associated table For a given entity p (call it a product) Collect all of the sizes assigned to […]