Application Helper Starter


/ Published in: Rails
Save to your folder(s)



Copy this code and paste it in your HTML
  1. def include_javascript( js_file )
  2. content_for( :javascripts ){ javascript_include_tag js_file }
  3. end
  4.  
  5. def include_stylesheet( css_file )
  6. content_for( :stylesheets ){ stylesheet_link_tag css_file }
  7. end
  8.  
  9. def add_body_id( id )
  10. content_for( :body_id ){ id }
  11. end
  12.  
  13. def heading( page_title )
  14. content_for( :heading ){ page_title }
  15. end
  16.  
  17. def class_name
  18. cycle "odd", "even"
  19. end

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.