Visto che per colpa di Davide D’Agostino (DAddYE) mi sono avvicinato a Rails (http://rubyonrails.org/) e sto cercando di creare per l’azienda dove lavoro, una piccola applicazione web per uso interno, ho deciso di farla in rails :D
L’ intenzione era di usare il js Ligh Window 2.0 (http://www.stickmanlabs.com/lightwindow/) che mi piace molto, ho deciso di fare un piccolo helper per poter “aggirare” un problema che ho pure io (ovviamente :P:P:P) (http://railsforum.com/viewtopic.php?pid=46594)
Alcune foto per far vedere come funziona questo plugin :D
In poche parole questo js non fa altro che “aprire” un div con dentro il percorso di quello che gli abbiamo passato in ingresso, all interno della pagina stessa (quindi niente pop-up, ma una finta pop-up interna :D)
Il funzionamento di questo helper è molto sempilice:
una volta installato il plugin tramite il comando
ruby scriptplugin install http://waydotnet.googlecode.com/svn/trunk/lightwindow_helper/
basta inserire nel file della “vista” il tag
<%= stylesheet_link_tag ’lightwindow’ %>
per poter avere a disposizione il css di lightwindow
e poi il tag per poterlo utilizzare è:
<%= lightwindow_link_to(name, options = {}, html_options = {}, *parameters_for_method_reference) %>
un esempio:
<%= lightwindow_link_to( “Click me !”, {:action => ’edit’, :id => “12/”}, :title => “This is a te st!”, :author=>“Carlo Bertini”, :caption=>“Ruby on rails is beautyfull :D” ) %>
Questo è tutto.
Ovviamente il repository è :
http://waydotnet.googlecode.com/svn/trunk/lightwindow_helper/
Ogni commento , giudizio, critica, migliorie, sono ben accette
ps: si lo so il mio italiano fa schifo :P
Share this post :
[ ](http://www.backflip.com/add_page_pop.ihtml?url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to backflip”)
[ ](http://www.blinkbits.com/bookmarklets/save.php?v=1&source_url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to blinkbits!”)
[ ](http://www.blogmemes.net/post.php?url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to blogmemes”)
[ ](http://buddymarks.com/s_add_bookmark.php?bookmark_url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&bookmark_title=[rails] LightWindowHelper [plugin helper] “Post it to buddymark”)
[ ](http://complore.com?q=node/add/flexinode-5&url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to complore”)
[ ](http://del.icio.us/post?url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&;title=[rails] LightWindowHelper [plugin helper] “Post it to del.icio.us”)
[ ](http://de.lirio.us/bookmarks/sbmtool?action=add&address=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to del.iri.ous!”)
[ ](http://digg.com/submit?phase=2&url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to digg”)
[ ](http://www.dotnetkicks.com/kick/?url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to dotnetkicks”)
[ ](http://www.furl.net/store?s=f&to=0&u=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&ti=[rails] LightWindowHelper [plugin helper] “Post it to furl”)
[ ](https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to live”)
[ ](http://ma.gnolia.com/bookmarklet/add?url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to magnolia!”)
[ ](http://netvouz.com/action/submitBookmark?url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to netvouz!”)
[ ](http://reddit.com/submit?url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to reddit!”)
[ ](http://www.shadows.com/bookmark/saveLink.rails?page=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to shadow”)
[ ](http://www.spurl.net/spurl.php?v=3&url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to spurl”)
[ ](http://technorati.com/faves/?add=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to technorati!”)
[ ](http://www.wists.com/?action=add&url=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&title=[rails] LightWindowHelper [plugin helper] “Post it to wists”)
[ ](http://myweb.yahoo.com/myresults/bookmarklet?u=http://blogs.ugidotnet.org/CarlitoWaY/archive/2007/12/11/rails-lightwindowhelper-plugin-helper.aspx&t=[rails] LightWindowHelper [plugin helper] “Post it to yahoo!”)
Technorati Tags: rails,ruby,ruby on rails,lightwindow,light window,carlo bertini,rails helper