Project

sex_it_up

0.01
No commit activity in last 3 years
No release in over 3 years
SexItUp allows for the easy drop-in of public domain images for site mockups and user avatars.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.0.0
~> 1.5.1
>= 1.0.0
>= 0
>= 2.3.5
~> 1.3.1

Runtime

>= 3.0.1
>= 3.0.1
>= 1.0.0
>= 2.3.5
 Project Readme

<img src=“https://secure.travis-ci.org/aantix/sex_it_up.png”/>

Description¶ ↑

Turn your boring demo website and placeholder images into a beautiful display of artwork.

In your Gemfile, add the following :

gem "sex_it_up", ">= 1.0.0"

Then perform the following from the root of your application directory :

bundle install

Now we need to copy over the needed migration :

rails g sex_it_up
rake db:migrate

Displaying Images¶ ↑

If you want to display a random image for the term ‘dog’, first add the following to your Rakefile :

require 'tasks/sex_it_up'

Once you have the rake task available, you can issue the following rake command to warm the image cache for a given term :

rake sex_it_up:cache[<Term>]

e.g. :
rake sex_it_up:cache["dog"]

Once the rake task has completed, change your erb view to call the following helper :

sexy_image('dog', :width => 100, :height => 100)

This helper will find a random image for the given term, scale it to the passed in dimensions, and display it.

Other Uses¶ ↑

If you wanted to replace your boring default user avatars, you could do the following

user.icon = SexItUp::SexItUpImage.find_all('dog').random.first

Sample Screenshot¶ ↑

Copyright © 2010-2012 Jim Jones. See LICENSE for details.