Ruby on Rails Tutorial【2012年英文第2版】

5星(超过95%的资源)
所需积分/C币:10 2013-08-08 11:03:55 12.95MB PDF
6
收藏 收藏
举报

Ruby on Rails Tutorial【2012年英文第2版】
Grounded in the real world IProgrammer(www.i-programmer.info),bylanelliot The book gives you the theory and practice, while the videos focus on showing you in person how its done. Highly recommended combo -antonio cangiano, Software engineer, Ibm The author is clearly an expert at the ruby language and the rails framework, but more than that, he is a working software engineer who introduces best practices throughout the text Greg Charles, Senior Software Developer, Fairway Technologies Overall, these video tutorials should be a great resource for anyone new to rails Michael Morin, ruby. about. com Hands-down, I would recommend this book to anyone wanting to get into ruby on rails development Michael Crump, Microsoft MVP RUBY ON RAILSTM TUTORIAL Second edition Addison-Wesley Professional Ruby Series Obie Fernandez. series Editor DISTRIBUTED PROGRAMMING REFACTORING RAILS WITH RUBY THE RAILS 3 WAY ANTIPATTERNS pwER积ENT积EC料 CHAO PYEL .TAMMER ALEN MARK BATES OEIE FERNANDEZ WVBR BM⊥E2 ÷ Addison- Wesley Visit informit com/huh for a complete list of availablle pproducts he Addison-Wesley Professional Ruby Series provides readers with practicall, people-oriemted, and in-depth information about applying the Ruby platform to create dynamic technology solutions The series is based on the premise that the need for expert reference books, written by experienced practitioners, will never be satisfied solely by blogs and the internet PEARSON AAddison-Wesley Cisco Press EXAMCRAM BM que: PRENTICE S/MS I Safari RUBY ON RAILSTM TUTORIAL Learn Web developments with rails Second edition Michael hart A Addison-Wesley pper Saddle river, NJ. Boston Indianapolis San Francisco eown· Sydney. Tokyo· Singapore Mexico Clip aris. Madrid New york· Toronto· Montreal· London· Munich·P Many of the designations used by manufacturers and sellers to distinguish their products are claimed Editor-in-Chief as trademarks. Where those designations appear in this book, and the publisher was aware of a Mark taub trademark claim, the designations have been printed with initial capital letters or in all capitals Executive Editor implied warranty of any kind and assume no responsibility for errors or omissions. No liability (o The author and publisher have taken care in the preparation of this book, but make no expressed or Debra Williams Cauley Managing Editor assumed for incidental or consequential damages in connection with or arising out of the use of th Johi n上 uler information or programs contained herein Full-Service Production The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or Manager special sales, which may include electronic versions and/or custom covers and content particular to Julie B. Nahil your business, training goals, marketing focus, and branding interests. For more information, please Project Manager contact U.S. Corporate and Government Sales Copy editor (800382-3419 Laserwords corpsales@pearsontechgroup.com Indexer For sales outside the United States please contact Laserword International sales Proofreader international@pearson.com Visit us on the Web: informit. com/aw Reviewer Jennifer Lindner Cataloging-in-Publication Data is on file with the Library of Congress Publishing Coordinator Copyright@ 2013 Michael Hartl Igheime Cover Desig All rights reserved. Printed in the United States of America. This publication is protected by Chuti Prasertsith copyright, and permission must be obtained from the publisher prior to any prohibited reproducti storage in a retrieval system, or transmission in any form or by any means, electronic, mechanica on, Compositor Laserwords photocopying, recording, or likewise. To obtain permission to use material from this work, please submit a written request to Pearson Education, Inc, Permissions Department, One Lake Street, Upper Saddle River, New Jersey 07458, or you may fax your request to(201)236-3290 The source code in Ruby on Rails M Tutorial is released under the MIT License ISBN13:978-0-321-83205-4 ISBN10:0-321-83205-1 Text printed in the United States on recycled paper at Edwards Brothers Malloy in Ann Arbor, Michigan First printing, July 2012 Contents Foreword to the First edition by derek siversxv Foreword to the First Edition by obie Fernandez xvii Acknowledgments xix about the author xxi Chapter 1 From Zero to Deploy 1 1 Introduction 3 1.1.1 Comments for various readers 4 1.1. 2"Scaling" Rails 7 1.1.3 Conventions in This book 7 1.2 Up and Running 1.2.1 Development Environments 10 1.2.2 Ruby, Ruby Gems, Rails, and git 12 1.2.3 The First Application 17 1. 2. 4 Bundler 19 1. 2.5 rails server 23 1.2.6 Model-view-controller(MvC) 25 1.3 Version Control with Git 27 1.3.1 Installation and Setup 27 1.3.2 Adding and Committing 30 1.3.3 What Good Does Git Do You? 31 Contents 1.3.4 Github 32 1.3.5 Branch, Edit, Commit, Merge 34 4 Deploying 39 1.4.1 Heroku Setup 39 1.4.2 Heroku Deployment, Step One 40 1.4.3 Heroku Deployment, Step Two 40 1.4.4 Heroku Co 5 Conclusion 43 Chapter 2 A Demo App 45 2. 1 Planning the ApI plication 45 2.1.1 Modeling Demo Users 47 2. 1.2 Modeling demo Microposts 48 2.2 The Users Resource 49 2.2.1 A User Tour 51 2.2. 2 MVC in Action 56 2.2.3 Weaknesses of this Users Resource 62 2.3 The Microposts Resource 63 2.3.1 A Micropost Microtour 63 2.3.2 Putting the micro in Microposts 66 2.3.3 A User has_many Microposts 68 2.3.4 Inheritance Hierarchies 70 2.3.5 Deploying the Demo App 73 2.4 Conclusion 74 Chapter 3 Mostly Static Pages 77 3. 1 Static Pages 82 3.1.1 Truly Static Pages 82 3.1.2 Static Pages with Rails 85 3.2 Our First Tests 93 3.2.1 Test-driven Development 93 3.2.2 Adding a Page 99 3.3 Slightly Dynamic Pages 103 3.3.1 Testing a Title Change 103 3.3.2 Passing Title Tests 106 3.3.3 Embedded Ruby 108 3.3.4 Eliminating Duplication with Layouts 111 3.4 Conclusion 114 Contents 3.5 Exercises 114 3.6 Advanced Setup 117 3.6.1 Eliminating bundle exec 118 3.6.2 Automated Tests with Guard 120 3.6.3 Speeding up Tests with Spork 123 3.6.4 Tests inside Sublime Text 127 Chapter 4 Rails-Flavored Ruby 129 4.1 Motivation 129 4. 2 Strings and Methods 134 4.2.1 Comments 13 4.2.2 Strings 135 4.2.3 Objects and Message Passing 138 4.2.4 Method Definitions 141 4.2.5 Back to the Title Helper 142 4.3 Other Data Structures 142 4.3. 1 Arrays and ranges 142 4.3.2 Blocks 146 4.3.3 Hashes and Symbols 148 4.3.4 CSS revisited 152 4.4 Ruby Classes 153 4.4.1 Constructors 153 4.4.2 Class Inheritance 155 4.4.3 Modifying Built-in Classes 158 4.4.4 A Controller Class 159 4.4.5 A User Class 161 4.5 Conclusion 164 4.6 Exercises 164 Chapter 5 Filling in the layout 167 1 Adding Some Structure 167 5.1.1 Site Navigation 169 5.1.2 Bootstrap and Custom CSs 175 5.1.3 Partials 181 5.2 Sass and the asset Pipeline 187 5.2.1 The Asset Pipeline 187 5.2.2 Syntactically awesome Stylesheets 190

...展开详情
试读 127P Ruby on Rails Tutorial【2012年英文第2版】
立即下载 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
jmp45 很清晰,内容有条理,易懂
2014-03-25
回复
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
关注 私信
上传资源赚钱or赚积分
最新推荐
Ruby on Rails Tutorial【2012年英文第2版】 10积分/C币 立即下载
1/127
Ruby on Rails Tutorial【2012年英文第2版】第1页
Ruby on Rails Tutorial【2012年英文第2版】第2页
Ruby on Rails Tutorial【2012年英文第2版】第3页
Ruby on Rails Tutorial【2012年英文第2版】第4页
Ruby on Rails Tutorial【2012年英文第2版】第5页
Ruby on Rails Tutorial【2012年英文第2版】第6页
Ruby on Rails Tutorial【2012年英文第2版】第7页
Ruby on Rails Tutorial【2012年英文第2版】第8页
Ruby on Rails Tutorial【2012年英文第2版】第9页
Ruby on Rails Tutorial【2012年英文第2版】第10页
Ruby on Rails Tutorial【2012年英文第2版】第11页
Ruby on Rails Tutorial【2012年英文第2版】第12页
Ruby on Rails Tutorial【2012年英文第2版】第13页
Ruby on Rails Tutorial【2012年英文第2版】第14页
Ruby on Rails Tutorial【2012年英文第2版】第15页
Ruby on Rails Tutorial【2012年英文第2版】第16页
Ruby on Rails Tutorial【2012年英文第2版】第17页
Ruby on Rails Tutorial【2012年英文第2版】第18页
Ruby on Rails Tutorial【2012年英文第2版】第19页
Ruby on Rails Tutorial【2012年英文第2版】第20页

试读结束, 可继续阅读

10积分/C币 立即下载