`
CaiDeHen
  • 浏览: 96869 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

#8 Layouts and content_for

阅读更多
If you want to change something in the layout on a per-template basis, content_for is your answer! This allows templates to specify view code that can be placed anywhere in a layout.
<!-- projects/index.rhtml -->
<% content_for :head do %>
  <%= stylesheet_link_tag 'projects' %>
<% end %>

<!-- layouts/application.rhtml -->
<head>
  <title>Todo List</title>
  <%= stylesheet_link_tag 'application' %>
  <%= yield :head %>
</head>

分享到:
评论

相关推荐

    WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4

    They explain how to use these controls to create flexible and responsive layouts that adapt to different screen sizes and resolutions. #### User Interaction Controls (Chapter 7 & Appendix D) User ...

    netWindows_0.3.0_pre2

    major re-structuring of inline constructor syntax for all widgets that provide inline constructors * Signals and Slots event mechanism now widely used throughout the API * new configuration directives...

    Responsive.Web.Design.with.HTML5.and.CSS3.Essentials

    Design and deliver an optimal user experience for all devices About This Book Get to grips with the core functionality of RWD through examples Discover how to make layouts, content and media flexible,...

    PhoneGap 3.x Mobile Application Development Hotshot.2014.pdf

    #### Book Content and Structure The book is structured around 12 projects that cover various aspects of mobile app development with PhoneGap 3.x. Each project focuses on a specific feature or ...

    mcts70-515_microsoft_trainingkit.pdf

    - **Master Pages and Themes:** Design patterns for creating reusable layouts and styles, enhancing consistency and maintainability across web applications. - **Server Controls:** Built-in controls ...

    Microsoft SharePoint 2010 Developer Reference

    - **Content:** Offers capabilities for managing documents, media, and other types of content. - **Search:** Enables powerful search functionalities within SharePoint sites. - **Insights:** Provides ...

    smashing-ebooks-editors-choice-library-treat

    This eBook is a part of The Smashing Library, which bundles valuable content into a single package for readers interested in web design, user experience (UX), and related topics. Let's delve deeper ...

    Android 4.0 Compatibility Definition

    - **Input Management Settings**: Settings related to input management, such as keyboard layouts and input methods, must be consistent across devices. ##### 3.9 Device Administration Device ...

    Introducing.JavaFX.8.Programming.0071842551.epub

    Designed for Java programmers, the book’s focus is on the JavaFX API and all examples are written entirely in Java. Best of all, the book is written in the clear, crisp, uncompromising style that ...

    Drupal 8 Explained: Your Step-by-Step Guide to Drupal 8

    Drupal 8 Explained is for people who want a fun and clear introduction to Drupal and requires absolutely no experience with Drupal, content management, site construction, programming, scripting, or ...

    HTML5.and.CSS3.Building.Responsive.Websites.pdf

    Chapter 3: Fluid Layouts and Responsive Images Chapter 4: HTML5 for Responsive Web Designs Chapter 5: CSS3 – Selectors, Typography, Color Modes, and New Features Chapter 6: Stunning Aesthetics with ...

    Preparing Written Messages

    This includes using appropriate fonts, colors, and layouts. In IT, visual design is particularly important for creating user interfaces, infographics, and presentations that are engaging and easy to ...

    Wrox.Professional.Android.Application.Development

    * Details for creating complex and compelling user interfaces by using, extending, and creating your own layouts and Views and using Menus. * A detailed look at data storage, retrieval, and sharing ...

    Professional Android 4 Application Development 源代码

    Chapter 8: Databases and Content Providers Introducing Android Databases Introducing SQLite Content Values and Cursors Working with SQLite Databases Creating Content Providers Using Content Providers ...

    salesforce dev 501 Notes

    - **Layout Components**: Components like panels, tabs, and layouts help in structuring the page's layout and content. - **Custom Components**: Developers can create their own reusable components by ...

Global site tag (gtag.js) - Google Analytics