This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function swapPhoto(photoSRC,theCaption,theLink) { | |
var displayedImage = document.getElementById("thephoto"); | |
var displayedCaption = document.getElementById("caption"); | |
// to make the link go to a new window, i just added 'target="_blank"' to both links below. | |
// target is just an attribute of the a tag in html | |
// | |
// however, i added a conditional to the image & link replacers. | |
// it says that if there is no third variable, there won't be any links. it's written as follows: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ImagesController < ApplicationController | |
session :cookie_only => false, :only => :upload_image_block | |
def upload_image_block | |
@image = Image.new(:file => swf_upload_data) # here you can use your favourite plugin to work with attachments | |
if @image.save | |
render :partial => 'image', :object => @image | |
else | |
render :text => "error" | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'fleakr' | |
class Fetchr < ActiveRecord::Base | |
# This script fetches flickr photos | |
@flickr ||= Fleakr.api_key = < my key > | |
@user ||= Fleakr.user('[email protected]') | |
@photos ||= @user.sets.first.photos | |
@photos.each do |photo| |
NewerOlder