Skip to content

Instantly share code, notes, and snippets.

@laktek
Created September 4, 2008 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laktek/8799 to your computer and use it in GitHub Desktop.
Save laktek/8799 to your computer and use it in GitHub Desktop.
make_resourceful do
actions :all
before :show do
@articles = current_object.articles
end
before :index do
@books = AmazonService::get('0QZ1AAT31TZ9RNVANY82', 'hackruby-20', 'ruby programming') unless read_fragment(:fragment => 'books')
@videos = YoutubeService::get('E45845C8A1F5726D', 3) unless read_fragment(:fragment => 'videos')
@ruby_links = DeliciousService::get unless read_fragment(:fragment => 'ruby_links')
end
response_for :create, :update do |format|
format.html do
expire_page :action => 'show'
set_default_flash(:notice, "Changes successful!")
set_default_redirect category_path(current_object.url_param)
end
end
response_for :show do |format|
format.html
format.rss {render :layout => false}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment