Skip to content

Instantly share code, notes, and snippets.

View massayoshi's full-sized avatar
👹

Flávio M. Oota massayoshi

👹
View GitHub Profile
@massayoshi
massayoshi / crontab
Last active August 29, 2015 14:06 — forked from airblade/crontab
@reboot cd /var/www/apps/myapp/current && bundle exec unicorn -c /var/www/apps/myapp/current/config/unicorn.rb -E production -D
#app/models/event.rb
class Event < ActiveRecord::Base
translates :title, :description
has_many :event_translations
accepts_nested_attributes_for :event_translations, :allow_destroy => true
end
class Controller
include LazyLoad
def show
@model = Model.find(...)
respond_to do |format|
format.html do
@html_specific_data = Model.find(...)
end