Gemfile
group :development do
gem 'powder'
gem 'pry-rails'
gem 'better_errors'
gem 'binding_of_caller'
gem 'meta_request'
Add images to your projects & users model using the Paperclip Gem
Implement Paperclip by one of three methods: Directly on Model, Through an associated model (Gallery Images), or through polymorphic associations across multiple models.
15.times do | |
u = FactoryGirl.create(:user) | |
pic = Picture.create image: File.open(Dir["/Users/ben/Pictures/Stock\ Photos/people/*.jpg"].sample) | |
u.picture = pic | |
Random.rand(6).times do | |
u.tags.create FactoryGirl.attributes_for(:tag) | |
end | |
Random.rand(10).times do | |
p = u.projects.create FactoryGirl.attributes_for(:project) | |
(1 + Random.rand(6)).times do |
Identify which Omniauth provider you want to integrate with.
Setup Devise for omniauth
https://github.com/intridea/omniauth https://github.com/intridea/omniauth/wiki/List-of-Strategies
# ... | |
gem 'pg' | |
# bundle install after, make sure you remove sqlite3, or other db gems | |
# ... |
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.
Don't look until you want to see how I thought through it:
15.times do | |
project = Project.create(:completion_date => Time.now + 5.days, :description => "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas posuere metus non erat lacinia scelerisque. Donec pharetra, orci ut sollicitudin egestas, augue enim pharetra tellus, nec pretium metus est ac ante. Nulla varius lacinia tortor, ac dapibus elit vehicula non. Praesent bibendum quis est sed varius. Integer accumsan fringilla est, a elementum metus pulvinar nec. Nullam commodo malesuada tortor in tincidunt. Nullam vel facilisis augue, et ornare neque. Nunc vitae odio aliquet, pharetra ante in, vestibulum erat. Duis sed fringilla turpis, vitae tempor nisl. Praesent quis hendrerit massa, in pretium mauris. Nunc luctus ac lectus ut consectetur. Ut convallis mauris eget ante viverra, porttitor euismod erat tincidunt. Maecenas et varius sem. Aenean a elit non nibh ultricies volutpat at nec dui. Suspendisse lobortis purus vitae ipsum consectetur, vel feugiat erat vehicula. \n \n Aenean vel elementum nibh, im |
$("#merchants-list tbody tr ").find('td:first :checkbox').each(function(){ | |
var $target = $(this), | |
value, | |
$indicator; | |
if ( $target.hasClass( "checkbox" ) ) { | |
// Check the check box | |
value = "1"; | |
$target.parents("tr:first").find("td:first :checkbox").attr("checked","checked"); | |
$indicator = $("<img src=\"/images/loader.dots.gif\" class=\"update-checkbox\" />"); |