VS Code setup
- Settings are listed in settings.json
- Editor Font: Operator Mono
- Terminal Font: SpaceMono NF
# db/migrate/XXXXXXXXXXXXX_add_authentication_token_to_users.rb | |
class AddAuthenticationTokenToUsers < ActiveRecord::Migration | |
def change | |
add_column :users, :authentication_token, :string | |
add_index :users, :authentication_token, :unique => true | |
end | |
end |
// Handy function to render dynamic parameters in a dust.js helper | |
function renderParameter(name, chunk, context, bodies, params) { | |
if (params && params[name]) { | |
if (typeof params[name] === "function") { | |
var output = ""; | |
chunk.tap(function (data) { | |
output += data; | |
return ""; | |
}).render(params[name], context).untap(); | |
return output; |
namespace :deploy do | |
namespace :assets do | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
from = source.next_revision(current_revision) | |
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0 | |
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile} | |
else | |
logger.info "Skipping asset pre-compilation because there were no asset changes" | |
end | |
end |
/* | |
Jquery and Rails powered default application.js | |
Easy Ajax replacement for remote_functions and ajax_form based on class name | |
All actions will reply to the .js format | |
Unostrusive, will only works if Javascript enabled, if not, respond to an HTML as a normal link | |
respond_to do |format| | |
format.html | |
format.js {render :layout => false} | |
end | |
*/ |