SlideShare une entreprise Scribd logo
1  sur  34
Télécharger pour lire hors ligne
BE NICE TO YOUR DESIGNERS:
  USEFUL TIPS FOR RAILS DEVELOPERS

          TaopaiC @ Ruby Tuesday
                2010/12/28
ABOUT ME

• Blog: http://pctao.org

• Twitter: TaopaiC
RAILS           !
           .
        .....
Designer               ,   ?




,   ?          Developer
Designer




  Developer
-
Designer
                  •         .
                  •RD   ,
                   .            .




  Developer
Designer




    Developer

?
-
Designer




    Developer
•       html/css    rails       ,   html   rails   ?

•               ,           .

•           ,                                  .



    •                                      .
•                  ,                       ,       model, method

    •                                                    ,         ,
                       .                             .

    •                                  ,       :

        •   : article, post, essay, words...

        •   : comment, response, reply...
CONTROLLER
class ArticlesController < ApplicationController
  def index
    @articles = Articles.paginate(:page => params[:page])
    @latest_comments = Comments.latest
  end
end




<h1>    </h1>
<div class="posts">
  <div class="post">
     <h2 class="post-name">      </h2>
     <p class="text">       Lorem...</p>
  </div>
</div>

<div class="new_responses">
<h2>        </h2>
  <div class="response">
     <h3>       </h3>
     <p class="reply">      Lorem...</p>
  </div>
</div>
<h1>    </h1>               article
<div class="posts">
<% @articles.each do |article| %>     post
  <div class="post">
     <h2 class="post-name"><%= article.title %></h2>
     <p class="text"><%= article.content %></p>
  </div>
<% end %>
</div>

<div class="new_responses">     comment
<h2>        </h2>
                                    response
<% @latest_comments.each do |comment| %>
  <div class="response">
     <h3><%= comment.title %></h3>
     <p class="reply"><%= comment.content %></p>
  </div>
<% end %>
</div>
•                                   .
                        ,       ?

    • CSS           .

    • image   tag           .

    •          ,                        .
(TABLE)
        html ...
,   Photoshop
       html ....
Photoshop   Slice   ,
HEADER (CSS            ):
      header.png

      LOGO (image tag             ):
      logo.jpg

                       :
      example_pic.png




CSS              image tag    ?
                      ...
•   ,       !!

•       .
,   ,CSS,JS
PHP
RAILS                                               ?

•       Rails   :

    • stylesheet_link_tag          public/stylesheets

        • CSS                      public/stylesheets/images

    • javascript_include_tag          public/javascripts

    • image_tag       public/images

    •                          ,             public/examples
CSS
•   Rails                   CSS                                   ,        HTTP
    request          .

•          :        css                               .
Rails
 <%= stylesheet_link_tag “reset.min.css”, “main.css”, “page.css”, :cache => "main-cache" %>



 <link href="/stylesheets/reset.min.css?1293518248" media="screen" rel="stylesheet"
 type="text/css" />
 <link href="/stylesheets/main.css?1293518252" media="screen" rel="stylesheet"
 type="text/css" />
 <link href="/stylesheets/page.css?1293518257" media="screen" rel="stylesheet"
 type="text/css" />



    <link href="/stylesheets/main-cache.css?1293518257" media="screen" rel="stylesheet"
    type="text/css" />
CSS -


•            ,   CSS                .

    :               css         ,
        ,                 ...
CSS (3)
/* homepage.css */
.header {
  background-image: "images/homepage_header.png"
}


/* post.css */
.header {
  background-image: "images/post_header.png"
}

•        CSS       ,                           ,
    .

•       CSS            ,                ,          ...
,
HANDICRAFT_HELPER                                ...
<body class="welcome-controller index-action">




     Controller              Action

 .welcome-controller.index-action
                           .
IE HACKS

• IE                            .

•                           :

    • Conditional   comment         Body class

    • Conditional   comment                CSS

    • CSS   HACKS...

•                       ,                        .
IE HACKS
• Conditional    comment                Body class
   <!--[if lt IE 7 ]>
   <body class="welcome-controller index-action ie6"><![endif]-->
   <!--[if gte IE 7 ]>
   <body class="welcome-controller index-action ie"><![endif]-->
   <!--[if !IE]>-->
   <body class="welcome-controller index-action">
   <!--<![endif]-->
                                               handicraft_helper


• Conditional     comment                          CSS
   <!--[if lt IE 7 ]>
   <link href="/stylesheets/ie6.css?1293518248" media="screen"
   rel="stylesheet" type="text/css" /><![endif]-->
   <!--[if gte IE 7 ]>
   <link href="/stylesheets/ie.css?1293518248" media="screen" rel="stylesheet"
   type="text/css" /><![endif]-->
•    ( handicraft_helper   list )

•    ( will_paginate )

•   ...
HANDICRAFT_HELPER                                            LIST


<ul>
  <li class="first current"><a href="#TODO">     </a></li>
  <li><a href=”#TODO”>     </a></li>
  <li class=”last”><a href="#TODO”>       </a></li>
</ul>
WILL_PAGINATE
                       disabled
<div>
    <span class="disabled prev_page">&laquo; Previous</span>
    <span class="current">1</span>
    <a href="./?page=2" rel="next">2</a>
    <a href="./?page=3">3</a>
    <span class="gap">&hellip;</span>
    <a href="./?page=29">29</a>
    <a href="./?page=30">30</a>
    <a href="./?page=2" rel="next" class="next_page">Next &raquo;</a>
</div>
•

    •

    •

    • CSS

    •

Contenu connexe

Tendances

Bootstrap: the full overview
Bootstrap: the full overviewBootstrap: the full overview
Bootstrap: the full overviewGill Cleeren
 
Bootstrap for Extension Developers JWC 2012
Bootstrap for Extension Developers  JWC 2012Bootstrap for Extension Developers  JWC 2012
Bootstrap for Extension Developers JWC 2012Andrea Tarr
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tipsChris Love
 
Joomla! Day Chicago 2011 - Templating the right way - Jonathan Shroyer
Joomla! Day Chicago 2011 - Templating the right way - Jonathan ShroyerJoomla! Day Chicago 2011 - Templating the right way - Jonathan Shroyer
Joomla! Day Chicago 2011 - Templating the right way - Jonathan ShroyerSteven Pignataro
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateInventis Web Architects
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucksTim Wright
 
LIS3353 SP12 Week 4
LIS3353 SP12 Week 4LIS3353 SP12 Week 4
LIS3353 SP12 Week 4Amanda Case
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
Modular HTML & CSS Workshop
Modular HTML & CSS WorkshopModular HTML & CSS Workshop
Modular HTML & CSS WorkshopShay Howe
 
Modular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo WorkshopModular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo WorkshopShay Howe
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSSRuss Weakley
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12ucbdrupal
 
Front End Web Development Basics
Front End Web Development BasicsFront End Web Development Basics
Front End Web Development BasicsTahir Shahzad
 
HTML/CSS Workshop @ Searchcamp
HTML/CSS Workshop @ SearchcampHTML/CSS Workshop @ Searchcamp
HTML/CSS Workshop @ SearchcampJames Mills
 

Tendances (20)

Bootstrap: the full overview
Bootstrap: the full overviewBootstrap: the full overview
Bootstrap: the full overview
 
Bootstrap for Extension Developers JWC 2012
Bootstrap for Extension Developers  JWC 2012Bootstrap for Extension Developers  JWC 2012
Bootstrap for Extension Developers JWC 2012
 
CSS Best practice
CSS Best practiceCSS Best practice
CSS Best practice
 
HTML News Packages Lesson
HTML News Packages LessonHTML News Packages Lesson
HTML News Packages Lesson
 
Css best practices style guide and tips
Css best practices style guide and tipsCss best practices style guide and tips
Css best practices style guide and tips
 
Joomla! Day Chicago 2011 - Templating the right way - Jonathan Shroyer
Joomla! Day Chicago 2011 - Templating the right way - Jonathan ShroyerJoomla! Day Chicago 2011 - Templating the right way - Jonathan Shroyer
Joomla! Day Chicago 2011 - Templating the right way - Jonathan Shroyer
 
Fronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-templateFronttechnieken met HTML5 en de Slice-template
Fronttechnieken met HTML5 en de Slice-template
 
Slow kinda sucks
Slow kinda sucksSlow kinda sucks
Slow kinda sucks
 
Team styles
Team stylesTeam styles
Team styles
 
LIS3353 SP12 Week 4
LIS3353 SP12 Week 4LIS3353 SP12 Week 4
LIS3353 SP12 Week 4
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Yuicss R7
Yuicss R7Yuicss R7
Yuicss R7
 
Modular HTML & CSS Workshop
Modular HTML & CSS WorkshopModular HTML & CSS Workshop
Modular HTML & CSS Workshop
 
Modular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo WorkshopModular HTML & CSS Turbo Workshop
Modular HTML & CSS Turbo Workshop
 
Efficient, maintainable CSS
Efficient, maintainable CSSEfficient, maintainable CSS
Efficient, maintainable CSS
 
BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12BDUG Responsive Web Theming - 7/23/12
BDUG Responsive Web Theming - 7/23/12
 
CSS Reset
CSS ResetCSS Reset
CSS Reset
 
Front End Web Development Basics
Front End Web Development BasicsFront End Web Development Basics
Front End Web Development Basics
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 
HTML/CSS Workshop @ Searchcamp
HTML/CSS Workshop @ SearchcampHTML/CSS Workshop @ Searchcamp
HTML/CSS Workshop @ Searchcamp
 

Similaire à Be nice to your designers

2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is nowGonzalo Cordero
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)François Massart
 
Diazo: Bridging Designers and Programmers
Diazo: Bridging Designers and ProgrammersDiazo: Bridging Designers and Programmers
Diazo: Bridging Designers and ProgrammersTsungWei Hu
 
Css for Development
Css for DevelopmentCss for Development
Css for Developmenttsengsite
 
Modular HTML & CSS
Modular HTML & CSSModular HTML & CSS
Modular HTML & CSSShay Howe
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSZoe Gillenwater
 
How to create a basic template
How to create a basic templateHow to create a basic template
How to create a basic templatevathur
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5Terry Ryan
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)christopherfross
 
Theme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgTheme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgThemeHorse
 
HTML 5 Drupalcamp Ireland Dublin 2010
HTML 5 Drupalcamp Ireland Dublin 2010HTML 5 Drupalcamp Ireland Dublin 2010
HTML 5 Drupalcamp Ireland Dublin 2010alanburke
 

Similaire à Be nice to your designers (20)

Web
WebWeb
Web
 
2022 HTML5: The future is now
2022 HTML5: The future is now2022 HTML5: The future is now
2022 HTML5: The future is now
 
The web context
The web contextThe web context
The web context
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
Diazo: Bridging Designers and Programmers
Diazo: Bridging Designers and ProgrammersDiazo: Bridging Designers and Programmers
Diazo: Bridging Designers and Programmers
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
Css for Development
Css for DevelopmentCss for Development
Css for Development
 
Modular HTML & CSS
Modular HTML & CSSModular HTML & CSS
Modular HTML & CSS
 
Death of a Themer
Death of a ThemerDeath of a Themer
Death of a Themer
 
Highly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSSHighly Maintainable, Efficient, and Optimized CSS
Highly Maintainable, Efficient, and Optimized CSS
 
How to create a basic template
How to create a basic templateHow to create a basic template
How to create a basic template
 
Artdm171 Week4 Tags
Artdm171 Week4 TagsArtdm171 Week4 Tags
Artdm171 Week4 Tags
 
Artdm171 Week5 Css
Artdm171 Week5 CssArtdm171 Week5 Css
Artdm171 Week5 Css
 
Html5
Html5Html5
Html5
 
Introduction to HTML5
Introduction to HTML5Introduction to HTML5
Introduction to HTML5
 
Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)Building the basics (WordPress Ottawa 2014)
Building the basics (WordPress Ottawa 2014)
 
Theme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.orgTheme Development: From an idea to getting approved to wordpress.org
Theme Development: From an idea to getting approved to wordpress.org
 
ARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSSARTDM 171, Week 5: CSS
ARTDM 171, Week 5: CSS
 
[heweb11] HTML5 Makeover
[heweb11] HTML5 Makeover[heweb11] HTML5 Makeover
[heweb11] HTML5 Makeover
 
HTML 5 Drupalcamp Ireland Dublin 2010
HTML 5 Drupalcamp Ireland Dublin 2010HTML 5 Drupalcamp Ireland Dublin 2010
HTML 5 Drupalcamp Ireland Dublin 2010
 

Dernier

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 

Dernier (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 

Be nice to your designers

  • 1. BE NICE TO YOUR DESIGNERS: USEFUL TIPS FOR RAILS DEVELOPERS TaopaiC @ Ruby Tuesday 2010/12/28
  • 2. ABOUT ME • Blog: http://pctao.org • Twitter: TaopaiC
  • 3. RAILS ! . .....
  • 4. Designer , ? , ? Developer
  • 6. - Designer • . •RD , . . Developer
  • 7. Designer Developer ?
  • 8. - Designer Developer
  • 9. html/css rails , html rails ? • , . • , . • .
  • 10.
  • 11. , , model, method • , , . . • , : • : article, post, essay, words... • : comment, response, reply...
  • 12. CONTROLLER class ArticlesController < ApplicationController def index @articles = Articles.paginate(:page => params[:page]) @latest_comments = Comments.latest end end <h1> </h1> <div class="posts"> <div class="post"> <h2 class="post-name"> </h2> <p class="text"> Lorem...</p> </div> </div> <div class="new_responses"> <h2> </h2> <div class="response"> <h3> </h3> <p class="reply"> Lorem...</p> </div> </div>
  • 13. <h1> </h1> article <div class="posts"> <% @articles.each do |article| %> post <div class="post"> <h2 class="post-name"><%= article.title %></h2> <p class="text"><%= article.content %></p> </div> <% end %> </div> <div class="new_responses"> comment <h2> </h2> response <% @latest_comments.each do |comment| %> <div class="response"> <h3><%= comment.title %></h3> <p class="reply"><%= comment.content %></p> </div> <% end %> </div>
  • 14. . , ? • CSS . • image tag . • , .
  • 15. (TABLE) html ... , Photoshop html ....
  • 16. Photoshop Slice ,
  • 17. HEADER (CSS ): header.png LOGO (image tag ): logo.jpg : example_pic.png CSS image tag ? ...
  • 18.
  • 19. , !! • .
  • 20. , ,CSS,JS
  • 21. PHP
  • 22. RAILS ? • Rails : • stylesheet_link_tag public/stylesheets • CSS public/stylesheets/images • javascript_include_tag public/javascripts • image_tag public/images • , public/examples
  • 23.
  • 24.
  • 25. CSS • Rails CSS , HTTP request . • : css . Rails <%= stylesheet_link_tag “reset.min.css”, “main.css”, “page.css”, :cache => "main-cache" %> <link href="/stylesheets/reset.min.css?1293518248" media="screen" rel="stylesheet" type="text/css" /> <link href="/stylesheets/main.css?1293518252" media="screen" rel="stylesheet" type="text/css" /> <link href="/stylesheets/page.css?1293518257" media="screen" rel="stylesheet" type="text/css" /> <link href="/stylesheets/main-cache.css?1293518257" media="screen" rel="stylesheet" type="text/css" />
  • 26. CSS - • , CSS . : css , , ...
  • 27. CSS (3) /* homepage.css */ .header { background-image: "images/homepage_header.png" } /* post.css */ .header { background-image: "images/post_header.png" } • CSS , , . • CSS , , ...
  • 28. , HANDICRAFT_HELPER ... <body class="welcome-controller index-action"> Controller Action .welcome-controller.index-action .
  • 29. IE HACKS • IE . • : • Conditional comment Body class • Conditional comment CSS • CSS HACKS... • , .
  • 30. IE HACKS • Conditional comment Body class <!--[if lt IE 7 ]> <body class="welcome-controller index-action ie6"><![endif]--> <!--[if gte IE 7 ]> <body class="welcome-controller index-action ie"><![endif]--> <!--[if !IE]>--> <body class="welcome-controller index-action"> <!--<![endif]--> handicraft_helper • Conditional comment CSS <!--[if lt IE 7 ]> <link href="/stylesheets/ie6.css?1293518248" media="screen" rel="stylesheet" type="text/css" /><![endif]--> <!--[if gte IE 7 ]> <link href="/stylesheets/ie.css?1293518248" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
  • 31. ( handicraft_helper list ) • ( will_paginate ) • ...
  • 32. HANDICRAFT_HELPER LIST <ul> <li class="first current"><a href="#TODO"> </a></li> <li><a href=”#TODO”> </a></li> <li class=”last”><a href="#TODO”> </a></li> </ul>
  • 33. WILL_PAGINATE disabled <div>     <span class="disabled prev_page">&laquo; Previous</span> <span class="current">1</span> <a href="./?page=2" rel="next">2</a> <a href="./?page=3">3</a> <span class="gap">&hellip;</span> <a href="./?page=29">29</a> <a href="./?page=30">30</a> <a href="./?page=2" rel="next" class="next_page">Next &raquo;</a> </div>
  • 34. • • • CSS •