Sha256: 5ec2096a4be94a83970dc7860e3fa45fe7d1d779730c4c61423fed7d9028d9f9
Contents?: true
Size: 1.78 KB
Versions: 18
Compression:
Stored size: 1.78 KB
Contents
module BivouacSample::Views def toggle_sortable html do head do javascript_include_tag :defaults stylesheet_link_tag "coderay" end body do h1 "sortable / sortable_element" ul( :id => 'my_list' ) do li( "Google", :id => "li_1" ) li( "Yahoo", :id => "li_2" ) li( "Accoona", :id => "li_3" ) li( "Ask.com", :id => "li_4" ) li( "Baidu", :id => "li_5" ) li( "Exalead", :id => "li_6" ) li( "Voila", :id => "li_7" ) li( "Lycos", :id => "li_8" ) end div( :id => "sortable" ) do button_to_function "Rendre la liste triable" do |page| page.toggle "sortable", "unsortable", "result" page.sortable( 'my_list', :onChange => { :update => 'result', :url => R(ToggleSortable) } ) end end div( :id => "unsortable", :style => "display: none;" ) do button_to_function "Rendre la liste non triable" do |page| page.toggle "sortable", "unsortable", "result" page.unsortable( 'my_list' ) end end div( :id => 'result', :style => "display: none;" )do; end hr p { span "Source du controller "; tt "app/controller/sortable_result.rb" } highlight_file( File.dirname( __FILE__ ) + "/../controllers/toggle_sortable.rb", :id => "source0") p { span "Source de la vue "; tt "app/views/toggle_sortable.rb" } highlight_file( __FILE__, :id => "source1" ) p { span "Source de la vue "; tt "app/views/_sortable_result.rb" } highlight_file( File.dirname( __FILE__ ) + "/_sortable_result.rb", :id => "source2") end end end end
Version data entries
18 entries across 18 versions & 1 rubygems