Don’t simply test for the presence of the magic Paperclip attribute, it will return a paperclip Attachment object and thus always be true:
- if user.photo.present? # always true
= image_tag(user.photo.url)| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
| # Edited from fork zhengjia/capybara cheat sheet | |
| # References | |
| # https://gist.github.com/zhengjia/428105 | |
| # http://www.railscook.com/recipes/capybara-cheat-sheet/ | |
| * [bold] expectation | |
| =Navigating= | |
| page.visit( '/projects’ ) < inclusion of page. is optional |
Oops! I accidentally deleted a local git branch, and I haven't pushed it to a remote server yet. The branch has several important commits, and it hasn't been merged with any other branches yet. How do I find the missing branch?
$ git fsck --full --no-reflogs --unreachable --lost-found
unreachable tree 4a407b1b09e0d8a16be70aa1547332432a698e18
unreachable tree 5040d8cf08c78119e66b9a3f8c4b61a240229259
unreachable tree 60c0ce61b040f5e604850f747f525e88043dae12
unreachable tree f080522d06b9853a2f18eeeb898724da4af7aed9##Objectives: Use String, Hash, Array, and Enumerable methods to decode a string and discover a secret message
INSPIRATION: http://www.youtube.com/watch?v=Wj1d85CLDOQ
##Skills: String.split, Array.each, Hash.each, Hash.sort_by, Range.to_a, Array.reverse, Array.push, Array.join, String.gsub, Array.index
##Instructions: Comments explain steps to manipulate string