Code Monkey home page Code Monkey logo

acts-as-slideshow's Introduction

ActsAsSlideshow
===============

This plugin lets you easily embed the Flex Slideshow component into your rails application.
All that is required to be done is to install it in the vendor/plugins directory and user and
photo models in place. Also this plugin could be used as a reference for creating rails plugins.

Usage:

Plugin provides a helper method 'embed_slideshow_tag' which lets you embed the Flex component
directly into your views. By default, the helper method would embed the supplied Flex_slideshow
component. As an addition, an argument could be passed to the method for using any other flex
file.

On the controller level, one needs to render user photo data using 'get_photo_data_xml' method
provided by the plugin. 

The Flex component uses a config xml file for setting the URI which is used for getting the user
photo information in xml format. Example shown below would have the URI in config file set as
http://localhost:3000/gallery/show_xml

Plugin provides rake tasks for copying the default Flex slideshow and config files to the public/flash 
directory.


Example
=======

Run from Rails application root directory:
1) rake slideshow:copy_flash_file
2) rake slideshow:copy_config_file

Both of the rake tasks could be run using the following task:
1) rake slideshow:copy_both

Using the ruby/script generator, user photos migration (if not already present) can be 
generated and executed.
1) ruby script/generate acts_as_slideshow_migration
2) rake db:migrate

View: (app/views/gallery/show_slideshow.html.erb)

<%= embed_slideshow_tag %>

Controller: (app/controllers/gallery/show_xml)

def show_xml
  user = User.find(session[:current_user])
  render :xml => user.get_photo_data_xml
end

Config.xml

<root>
  <config>
    <flex-app-title>Smartsourcing Global Flex SlideShow</flex-app-title>
    <DataUrl><![CDATA[http://localhost:3000/gallery/show_xml]]></DataUrl>
    <thumb-width>100</thumb-width>
    <thumb-height>120</thumb-height>
  </config>
</root>


Credits
======
Gaurav Sohoni | [email protected]
------------------------------------------------------------------------------
Released under the MIT license.
Copyright © 2010 Gaurav Sohoni | http://github.com/gaurav-sohoni

acts-as-slideshow's People

Watchers

GIJoe avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.