Skip to content

Instantly share code, notes, and snippets.

@suparerk
suparerk / Procfile
Created October 23, 2019 06:40
Procfile fore rails + webpacker
web: bundle exec rails s
webpacker: NODE_ENV=production ./bin/webpack --watch --colors --progress
@suparerk
suparerk / sql_to_activerecord_example.rb
Created February 22, 2018 03:07
example of converting raw sql to activerecord
query = "SELECT Sum(score) AS score,
Sum(range) AS range
FROM best_results br
JOIN chapters c
ON br.chapter_id = c.id
JOIN lessons l
ON c.lesson_id = l.id
JOIN units u
ON l.unit_id = u.id
WHERE br.user_id = '#{user.id}'
@suparerk
suparerk / rails-postgres-backbone-bootstrap-bootswatch
Created January 19, 2017 15:58 — forked from sionc/rails-postgres-backbone-bootstrap-bootswatch
Instructions on creating a new app using Ruby on Rails, Postgresql, Backbone.js, Twitter Boostrap, Bootstwatch
- Check rails version
$ rails -v
- To update rails
$ gem update rails
- Creating a new rails app using postgresql
$ mkdir rails_projects
$ cd rails_projects
$ rails new myapp --database=postgresql