using Unicorn, Nginx, PostgreSQL, active_storage, Amazon S3. Combined summary of all guides.
Your root password is e-mailed to you.
| if ($request_uri ~* ^(.+)\?page=1$) { | |
| set $dom_prefix $1; | |
| set $args ''; | |
| rewrite ^(.*)$ $scheme://$host$dom_prefix permanent; | |
| break; | |
| } | |
| if ($request_uri ~* ^(.+)\?page=(\d+)$) { | |
| set $dom_prefix $1; | |
| set $page $2; | |
| set $args ''; |
| INSTALL JAVA | |
| $ sudo apt-get update && sudo apt-get install default-jre | |
| INSTALL ELASTIC SEARCH https://www.elastic.co/guide/en/elasticsearch/reference/current/setup-repositories.html | |
| $ wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add - | |
| $ echo "deb https://packages.elastic.co/elasticsearch/2.x/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elasticsearch-2.x.list | |
| $ sudo apt-get update && sudo apt-get install elasticsearch | |
| $ sudo update-rc.d elasticsearch defaults 95 10 | |
| $ sudo service elasticsearch restart | |
| $ sudo service elasticsearch status |
| class Attachment < ActiveRecord::Base | |
| mount_uploader :attachment, AttachmentUploader | |
| # Associations | |
| belongs_to :attached_item, polymorphic: true | |
| # Validations | |
| validates_presence_of :attachment |
| class Controller | |
| include LazyLoad | |
| def show | |
| @model = Model.find(...) | |
| respond_to do |format| | |
| format.html do | |
| @html_specific_data = Model.find(...) | |
| end |
| $.rails.allowAction = function(element) { | |
| var message = element.data('confirm'); | |
| if (!message) { | |
| return true; | |
| } | |
| bootbox.confirm(message, function(result) { | |
| if (result) { | |
| $.rails.handleMethod(element); | |
| } |