Sha256: 08fe9f35b0af39e6efc78676959b358b6b4dc6841d14eb8f8eb18110e22ae560

Contents?: true

Size: 1.68 KB

Versions: 30

Compression:

Stored size: 1.68 KB

Contents

!!! 5
%html
  %head
    %meta(content="text/html; charset=utf-8" http-equiv="Content-Type")

    %title= page_title

    = csrf_meta_tag
    = javascript_include_tag( 'application' )
    = stylesheet_link_tag "application"

  = content_tag :body, data: { id: Time.now.to_i } do

    -# No need to do call Ajaxify.init obtrusively in your app. Just call it from your js/coffeescript file, as early as possible.
    -# I only do it hackishly here to access the rails session.
    :javascript
      Ajaxify.init( { push_state_enabled: #{(session[:push_state_enabled] == false) ? 'false' : 'true'}, active: #{session[:ajaxify] ? 'true' : 'false'} } );

    - sleep 1

    %h1#title
      Ajaxify Rails Demo (more info: #{link_to('ajaxify_rails gem', 'https://github.com/ncri/ajaxify_rails')})

    #hints
      - if session[:ajaxify]
        Navigate. Note the difference. Also try out the browser's back and forward buttons.
      - else
        Navigate. Then switch on Ajaxify (checkbox right).

    #notice{ style: "#{'display:none' unless flash[:notice]}" }= flash[:notice]

    #navigation
      #toggle_ajaxify
        Ajaxify
        = check_box_tag :ajaxify, '1', session[:ajaxify]
      %ul
        %li= link_to 'Home', '/', class: current_page?('/') ? 'active' : nil
        %li= link_to 'Page 1', '/home/page1', class: current_page?('/home/page1') ? 'active' : nil
        %li= link_to 'Page 2', '/home/page2', class: current_page?('/home/page2') ? 'active' : nil
        %li= link_to 'Page 3 (redirects to page 1)', '/home/page3', class: current_page?('/home/page3') ? 'active' : nil

    #main
      = yield

    #footnote
      Note: Layout rendering is delayed by one second to simulate a complex layout.

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ajaxify_rails-0.9.7 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.9.6 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.9.5 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.9.4 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.9.3 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.9.2 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.9.1 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.9.0 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.9 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.8 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.7 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.6 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.5 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.4 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.3 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.2 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.1 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.8.0 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.7.8 spec/ajaxify_test/app/views/layouts/application.html.haml
ajaxify_rails-0.7.7 spec/ajaxify_test/app/views/layouts/application.html.haml