Contents:
- show full path for the item
- show tree in ol li
- show tree in dropdown select
- one item
#Goal Deploy your Rails App super easily with Dokku on Digital Ocean cheap cheap!
##Notes
Procfile with the command to start up your application serverLogentries (not in this guide)AppSignal or New Relic (not in this guide)| module ApplicationHelper | |
| def active_for(options = {}) | |
| name_of_controller = options[:controller] || nil | |
| name_of_action = options[:action] || nil | |
| request_path = options[:path] || nil | |
| if request_path.nil? | |
| if (name_of_action.nil? or name_of_action == action_name) and | |
| name_of_controller == controller_name | |
| 'active' |
| <fieldset> | |
| <div class="form-inline" style="margin-bottom:10px;"> | |
| <div class="form-group"> | |
| <%= f.text_field "synonyms[value]", class: "form-control" %> | |
| </div> | |
| <div class="form-group"> | |
| <%= f.text_field "synonyms[synonyms]", class: "form-control", style: 'width: 300px;' %> | |
| </div> |
TL;DR Como configurar uma aplicação Rails usando Nginx + Unicorn + Upstart + RVM (gemset por aplicação).
Dependências: (TODO) Configuração de Servidor Nginx
Essas instruções são aplicáveis para o seguinte ambiente:
| ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa | |
| ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa | |
| ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa |
| def render | |
| pdf = Prawn::Document | |
| pdf.image StringIO.new(Base64.decode64(splitBase64(BASE64_IMAGE_GOES_HERE)[:data])), at: [10, cursor - 50], width: 200, height: 125 | |
| end | |
| def splitBase64(uri) | |
| if uri.match(%r{^data:(.*?);(.*?),(.*)$}) | |
| return { | |
| type: $1, # "image/png" | |
| encoder: $2, # "base64" |
| Model: | |
| create_table :products do |t| | |
| ... | |
| t.decimal :price, :precision => 8, :scale => 2, :default => 0.0 | |
| ... | |
| end |