= link_to "delete profile", user_path(@user), method: :delete
def destroy
@user = User.find(params[:id])
@user.destroy
source 'https://rubygems.org' | |
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' | |
gem 'rails', '4.0.0' | |
gem "railties" | |
gem 'jquery-rails' | |
gem 'filepicker-rails' | |
gem 'counter_culture', '~> 0.1.18' | |
gem 'neat' |
gem install nokogiri -- --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib | |
bundle config build.nokogiri --global --with-xml2-include=/usr/local/Cellar/libxml2/2.9.1/include/libxml2 --with-xml2-lib=/usr/local/Cellar/libxml2/2.9.1/lib | |
var post = $('.wall-post-copy').first(); | |
if (post.children().first().attr('target') == "_blank") { | |
post.children().first().css('display', 'none') } |
// Get proper container height | |
function getContainerHeight(){ | |
var myHeight = $('#my-header').outerHeight(), | |
var yourHeight = $('#deal-details').height(), | |
containerHeight = ( myHeight > yourHeight ? myHeight : yourHeight ); | |
return containerHeight; | |
} |
= content_for :meta do | |
meta content=FACEBOOK['client_id'] property="fb:app_id" / | |
meta content=@user.url property="og:url" / | |
meta content=@user.short_title property="og:title" / | |
meta content=@user_sharing.facebook_data[:description] property="og:description" / | |
meta content=@user_sharing.facebook_data[:photo_url] property="og:image" / | |
meta content="summary" name="twitter:card" / | |
meta content="@lettucebooks" name="twitter:site" | |
meta content=@user.url name="twitter:url" | |
meta content=@user.short_title name="twitter:title" |
// Arguments look like array's but are not. But you can add array functionality with prototype. | |
function Max(x,y,z) { | |
var args = Array.prototype.slice.call(arguments); | |
return args; | |
} |
// Use index of to check contents of array. | |
// A function that takes a character (i.e. a string of length 1) and returns true if it is a vowel, false otherwise. | |
function isVowel(letter) { | |
vowels = ['a','e','i','o','u']; | |
var result = vowels.indexOf(letter) | |
if (result >= 0) { | |
return true; | |
} | |
else { |
function sum ( args ) { | |
var array, sum = 0; // Set vars | |
// Conditional to type check what the arguments are | |
if ( typeof args == 'number' ) { // If not an array, then convert it to one. | |
array = Array.prototype.slice.call(arguments, 0); // Gotcha, using the key word 'arguments', not the 'args' word. 'arguments' is a special word in javascript that looks like an array, but is not. | |
} else { | |
array = args; | |
} | |
for ( i in array ) { // I assume recursion could be used here if I knew how recursion worked. |