Using Rails and the Flickr API


Hi all,

Week 2 of my Rails experience and I’m loving life!

This is one of my first times consuming a web service, but the Rails
demo made the process very exciting… I followed along with the video
and have my own little Flickr search up and running! Woo hoo!

So now I want to do a bunch of other things to it and I’m struggling…
excuse my ignorance, but is there some extensive Ruby/Rails/Flickr
document somewhere? I’d like to get some clues about how all the
different pieces fit together: -

flickr_controller.rb -

class FlickrController < ApplicationController
def search
flickr = ‘API_KEY’
render :partial => “photo”, :collection => => params[:tags], :per_page => ‘24’)

views/flickr/index.rhtml -

<%= form_remote_tag :url => {:action => ‘search’}, :update => ‘photos’,
:complete => visual_effect(:blind_down, ‘photos’),
:before => %(‘spinner’)),
:success => %(Element.hide(‘spinner’)) %>

<%= image_tag ‘/images/spinner.gif’, :id => ‘spinner’, :style =>
‘display: none’ %>

Tags: <%= text_field_tag 'tags' %> <%= submit_tag 'Find' %>
<%= end_form_tag %>

views/flickr/_photo.rhtml -