Skip to content

Instantly share code, notes, and snippets.

@sandipransing
Created July 12, 2011 10:27
Show Gist options
  • Select an option

  • Save sandipransing/1077744 to your computer and use it in GitHub Desktop.

Select an option

Save sandipransing/1077744 to your computer and use it in GitHub Desktop.
layout file in rails
cat app/views/layouts/homepage.html.haml
- content_for :layout_head do
%script{:type=>"text/javascript", :src=>"http://maps.google.com/maps/api/js?sensor=false"}
- google_apis = 'https://ajax.googleapis.com/ajax/libs'
= javascript_include_tag "#{google_apis}/jquery/1.4.4/jquery.min.js"
= javascript_include_tag "#{google_apis}/jqueryui/1.8/jquery-ui.min.js"
= javascript_include_tag %w(rails application), :cache => false
= javascript_include_tag %w(placeholder maps.tooltip gmap jquery.qtip.min)
= javascript_include_tag "/javascripts/easySlider1.7.js"
:javascript
jQuery(document).ready(function(){
$('#notice_display').delay('5000').slideUp('slow');
$('.tooltip').fadeIn('slow');
$('.tooltip .close a').click(function(){
$(this).parents('.tooltip').fadeOut('normal');
return true;
})
});
- unless content_for? :layout_content
- content_for :layout_content do
%body.landing
= #FIXME browser_check
= display_notices
= content_for?(:layout_header) ? yield(:layout_header) : render('layouts/header')
%div{:id => "fb-root"}
= yield
.clr
= render 'layouts/footer'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment