Skip to content

Instantly share code, notes, and snippets.

View mallikarjunece's full-sized avatar
🤑
Learning && Coding......!

Mallikarjuna mallikarjunece

🤑
Learning && Coding......!
View GitHub Profile
@mallikarjunece
mallikarjunece / index.md
Last active August 29, 2015 14:16 — forked from rstacruz/index.md

Rails Models

Generating models

$ rails g model User

Associations

belongs_to

has_one

@mallikarjunece
mallikarjunece / rails.rb
Last active August 29, 2015 14:10 — forked from benedikt/rails.rb
# encoding: UTF-8
Capistrano::Configuration.instance(:must_exist).load do
namespace :rails do
desc "Open the rails console on one of the remote servers"
task :console, :roles => :app do
hostname = find_servers_for_task(current_task).first
exec "ssh -l #{user} #{hostname} -t 'source ~/.profile && #{current_path}/script/rails c #{rails_env}'"
end
end