text:
The requested quantity is not available.
Traveler's Striped Chest with Casters - Linen
Item # BBFU0853
♦ Dimensions
19.25 "W x 16.0 "D x 26.0 "H
♦ Quantity
$ 229.99
$ 116.99
In stock and ready to ship!
Out of stock
DescriptionTake a sentimental journey with this Traveler's Striped Chest with casters. Upholstered in linen canvas and detailed in faux saddle brown leather. The look-alike steamer chest has three deep drawers with clever faux leather luggage pulls and casters. Immaculately finished with top stitching, faux leather detailing, brass tone nailheads, and an eye- catching racing stripe. The Traveler's Striped Chest makes a novel end table, bedside table, or hallway statement.Canvas fabricBombay ExclusiveFaux leatherFiberboardMetal accentsLuggage casters
Care Instructions
Delivery Options
- Standard Shipment for $ 22.50
- Express Shipment for $ 37.45
- Overnight Shipment for $ 52.45
Shipping Information
Shipping charges are estimated. You will choose your shipping method during checkout.Shipping Information
- ♦ Description
- ♦ Care
- ♦ Shipping


text:
Take a look at suite-wide enhancements like cloud integration, Touch Mode, PDF editing, and Ribbon customization, as well as individual app improvements added to Office 2013.
"My biggest problem is figuring out what I want to watch next. Just when I think I'm all set, I find something ELSE that is fascinating." —John O.
more from our members »

subset: commoncrawl


text:
You can learn more about use of complementary and alternative medicine through Bastyr University's continuing and community education courses.Read more »
Bastyr's new Master of Arts in Counseling Psychology program draws on the University's distinctive integrative approach to mental, spiritual and physical wellness.Read more »
It's tradition for Bastyrians to mark the first day of the winter quarter with a dash down the trail to Lake Washington and a dip into the chilly water.Check it out »
Sharon Gray, MS ('06), LAc, is one of many Bastyr graduates whose own health journey inspired her to join a healing profession. Now she's growing a practice and creating a cookbook that draws on crowd-sourced variations of a single simple recipe.Read more »
AOM student Emily Paul found herself learning cross-cultural communication on the fly at the Rainier Park Medical Clinic. That sort of real-world training is exactly the point of Bastyr's external clinical training.Read more »
2012 promises to be a year filled with celebrations, milestones and new additions that are sure to keep our community buzzing with excitement and anticipation all year long.Read more »
Two pioneers of the birth vocations field, Penny Simkin, namesake of the University's Simkin Center, and Phyllis Klaus, are joining together to teach the unique, two-day class "When Survivors Give Birth."Read more »
Bastyr President Daniel K. Church, PhD, takes a look back at 2011 and anticipates even more to come in 2012.Read more »
Now you can make the vegetarian, vegan and a healthy traditional Thanksgiving menus that were available to dining commons patrons in November 2011.Read more »
Debra Brammer, ND, discusses "Herbs to Support Immunity," and offers a list of her family's favorite immune-boosting recipes.Read more »


text:
Quick Links
Shop All Jewelry
ERZ10038 In Stock
A 6 mm round, brilliant cut cubic zirconia in a delicate shade of pink, sparkles in these sterling silver stud earrings. They have push backs and the sterling silver has a polished finish. The color is delightful, and the price is terrific on these sterling silver earrings.
Eve's Addiction.com wants you to be a happy customer. We want you to be completely satisfied with the sterling silver jewelry that you receive from us, as we only sell high quality silver and cubic zirconia cz jewelry. We do understand that you may not like your purchase for some reason.
You may return or exchange your jewelry within 60 days of purchase if you are not satisfied with it. The jewelry must be returned in its original condition for a refund or exchange. Engraved, personalized, photo, monogram, name and initial, chocolate and clearance items are not returnable or exchangeable.


text:
The Best Reds: Lipsticks to Try Now
This king of vegetable is not only the most nutrient-dense food on the planet, it also helps suppress the appetite and clears toxins from the body. Four cups of kale (the amount you'd use for a salad) has 10 grams of fiber and enough detoxifying nutrients to super-charge your liver's detoxification pathways for 48 hours! A cleaner body means fewer cravings for sugar and fried food, your fat cells' greatest allies.
Easy meal ideas: Assemble a raw kale salad with avocado, yellow peppers, and grape tomatoes; try crunchy kale chips; or sip on a cooling green vegetable juice.
Who knew that food could talk to your fat cells? That's exactly what the phytonutrient sulforaphane in broccoli rabe does. It stimulates an enzyme that tells your fat cells to burn fat. Meet your negotiator.
Easy meal ideas: Sauté broccoli rabe with lemon zest and chili flakes, mix broccoli rabe and sweet Italian sausage together, or toss broccoli rabe and summer squash with olive oil, mint, lemon juice, and pine nuts.
25 Beauty Buys ELLE Editors Can't Live Without


text:
The Power of Independent Thinking
Ivan Eland on The Tom Woods Show
Recorded: Monday, February 17, 2014
Ivan Eland, author of Recarving Rushmore, appeared on the The Tom Woods Show. Eland talks about U.S. Presidents on the merits of their policies and whether those strategies contributed to peace, prosperity, and liberty.
Experts: Ivan ElandType: RadioIssues: Economic History and Development (U.S.), History (U.S), Political Ideology and Philosophy
David J. Theroux on Price of Business Radio Show
Recorded: Tuesday, February 11, 2014
Host Kevin Price and Independent Institute President and Founder David Theroux discuss the topic How to Maintain Liberty in this segment of the Price of Business on KTEK 1110 AM of the Wall Street Radio Network.
Experts: David J. TherouxType: RadioIssues: Culture/ Society, Economic Policy, Free Market Economics, Political Ideology and Philosophy
Obamacare: Built to Fall Apart
Recorded: Thursday, January 30, 2014
Sr. Fellow John R. Graham appeared on the Joy Tiz radio show. Graham talks about the new Healthcare Contract with America, which relies on free market solutions to solve the healthcare crisis. Using examples from the landmark book by Sr. Fellow John C. Goodman, Priceless: Curing the Healthcare Crisis, Graham describes ways in which Americans can take control of their healthcare.
Experts: John R. GrahamType: RadioIssues: Economic Policy, Free Market Economics, Health Care, Political Ideology and Philosophy, Public Health/ Consumer Protection
Ivan Eland on South Africas Platinum Workers Strike
Recorded: Monday, January 27, 2014
Sr. Fellow Ivan Eland appears on Arise TV to discuss the economy in South Africa, which is facing a strike against platinum producers, threatening to plunge the countrys economy into a deeper hole.
Experts: Ivan ElandType: TelevisionIssues: Business, Economic History and Development (International), Economic Policy, Labor and Employment
Is ObamaCare Doomed In Its Current Form?
Recorded: Monday, January 27, 2014
Watch the latest video at video.foxbusiness.com
Sr. Fellow and author of Priceless: Curing the Healthcare Crisis, John C. Goodman, appeared on the Lou Dobbs Tonight show on Fox Business News network. Goodman discusses the reasons why Obamacare in its current form, is on a so-called "Death Spiral" and must be replaced with a free market system that eliminates a mandate to purchase insurance.
Experts: John C. GoodmanType: TelevisionIssues: Economic Policy, Free Market Economics, Health Care, Public Health/ Consumer Protection
Lawrence McQuillan on The Jason Lewis Radio Show
Recorded: Thursday, January 16, 2014
Sr. Fellow Lawrence McQuillan was a guest on the Jason Lewis radio show. He discussed the economics and history of totalitarianism vs capitalism in terms of policies such as higher taxes for corporations, farm subsidies, price and rent controls and endless money supply and how history can show us which of these stifle prosperity. Private property and individualism are the foundations of freedom, argues McQuillan.
Experts: Lawrence J. McQuillanType: RadioIssues: Culture/ Society, Government Power, History (International), History (U.S), Political Ideology and Philosophy, Property Rights
Benjamin Powell on Economic Recovery
Recorded: Friday, January 3, 2014
What will the economy be like in the New Year? Sr. Fellow Benjamin Powell appears on Fox Business Network's "The Independents" show to give his impressions of the deficit, bureaucracies, and economic recovery. Powell talks about long term trends and says Big Government policies are effecting the outlook and the "New Normal" in the economy.
Experts: Benjamin W. PowellType: RadioIssues: Economic History and Development (U.S.), Economic Policy, Political Ideology and Philosophy
Ivan Eland on Russian Aid to Ukraine
Recorded: Wednesday, December 18, 2013
Sr. Fellow Ivan Eland appears on CCTV to discuss Russias relationship with Ukraine. Eland discusses Ukraine's interests in dealing with Europe vs Russia.
Experts: Ivan ElandType: TelevisionIssues: Culture/ Society, Economic History and Development (International), Economic Policy, History (International), Politics


text:
Faculty and Staff
Dr. Robin L. L. Murray
Professor of English and Women's Studies, Film Studies Minor Coordinator, and Eastern Illinois Writing Project Director
Office: 3351 - Coleman Hall
Phone: 217-581-2428
Email: firstname.lastname@example.com
Website: http://castle.eiu.edu/filmmnor/
Robin L. Murray's Vita
Office Hours: M 1:00-3:00 p.m.; TR 2:00-3:15 p.m.
Robin L. Murray teaches courses in film studies, English education, and multicultural American literature. Her research and service interests are in ecocriticism and film studies, women's studies, and composition theory and practice. She has co-authored four books: Ecology and Popular Film: Cinema on the Edge (SUNY Press 2009), That's All Folks?:Ecocritical Readings of American Animated Features (U Nebraska Press 2011), Gunfight at the Eco-Corral: Western Film and the Environment (U Oklahoma Press 2012), and Everyday Ecodisasters in Documentary and Fictional Films (U Nebraska Press 2014). Her work has appeared in Film Quarterly, Interdisciplinary Studies in Literature and the Environment, Jump Cut, and other film and literary journals.
She also directs the Eastern Illinois Writing Project (www.eiu.edu/~easternnwp) and coordinates the Film Studies Minor.
Frequently Taught CoursesEnglish 3504, Film and Literature
English 4904, Studies in Film
English 5585, Eastern Illinois Writing Project Summer Institute
English 3401, Methods of Teaching Composition
Engiish 3402, Methods of Teaching Literature
English 3705, Multicultural American Literature
EducationPhD, University of Toledo; M.A., The Ohio State University; B.A., Oakland University
Speakers Bureau
For more information, please visit the Speakers Bureau Webpage.
ResearchFilm studies, English education, multicultural American literature, eco-criticism, women's studies, composition theory, nineteenth- and early twentieth-century American studies.
Selected PublicationsPublications
Ecology and Popular Film: Cinema on the Edge. SUNY Press. 2009. (with Joseph K. Heumann).
That's All Folks?: Ecocritical Readings of American Animated Features. University of Nebraska Press, 2011. (with Joseph K. Heumann)
Gunfight At the Eco-Corral: Western Cinema and the Environment. University of Oklahoma Press, 2012. (With Joseph K.Heumann).
Film and Everyday Eco-Disaster. University of Nebraska Press, 2014. (With Joseph K. Heumann)
"Activism in Mountaintop Removal Films: Turn off the Lights for Sustainability." Interactions: Studies in Communication in Culture. Forthcoming Summer 2013. (with Joseph K. Heumann).
"James Bond and Water Wars in Contemporary Film: A New Eco-Warrior?" With Sustainability and Justice For All volume. Forthcoming. (with Joseph K. Heumann).
"Give Me Shelter: The Ecology of the Home in Blue Vinyl and Libby, Montana." Jump Cut. Forthcoming (With Joseph K. Heumann).
"Hatari Means Danger: Filmic Representations of Animal Welfare and Environmentalism at the Zoo." Quarterly Review of Film and Video. Forthcoming. (with Joseph K. Heumann)
"Flipper? We're Eating Flipper?: Documenting Animal Rights and Environmental Ethics at Sea." Moving Environments: Affect, Emotion, Ecology, and Film. Under contract with Wilfrid Laurier University Press. Forthcoming.
"Contemporary Eco-Food Films: The Documentary Tradition." Studies in Documentary Film. 6.1 (Winter 2012). (with Joseph K. Heumann).
"Bambi andMr. Bug Goes to Town: Nature, With or Without Us." Winter 2011.Interdisciplinary Studies in Literature and the Environment. (With Joseph K. Heumann).
"The Burning Season: Environmentalism Versus Progress?" A Little Solitaire: John Frankenheimer on the American Screen. Ed. Murray Pomerance and R. Barton Palmer. Rutgers University Press. 2011: 117-128. Print.
"Women Miners, Women Protesters: A Neglected Image." The Artist as Activist in Appalachia. Ed. Amy Childers-Mansfield and Joyce E. Stavick. University Press of North Georgia, 2011. (With Joseph K. Heumann).
"Fast, Furious, and Out of Control: The Erasure of Natural Landscapes in Car Culture Films." Framing the World. Ed.Paula Willoquet. University of Virginia Press, 2010. (With Joseph K. Heumann).
"Oil Drilling and the Search for the 'Golden Shrimp': The Myth of Interdependence in Oil Drilling Films." Jump Cut. 53. 2011. Web. (With Joseph K. Heumann).
"Mining Westerns: Seeking Sustainable Development in McCabe and Mrs. Miller. The Journal of Ecocriticism. July 2010. (With Joseph K. Heumann).
"Passage as Journey in Sherman Alexie's Smoke Signals: A Narrative of Environmental Adaptation." Jump Cut. Summer 2010. With Joseph Heumann.
"WALL-E: From Environmental Adaptation to Sentimental Nostalgia" Jump Cut. Spring 2009. (With Joseph K. Heumann).
"Ecocriticism and Interdisciplinarity: Giving a Feminist Voice to Nature." Open Words. Fall 2009.
"Poetry Introduction." Illinois English Bulletin. Spring 2009, Spring 2010, Spring 2011.
Selected Conference PresentationsSelected Conference Presentations, 2009-Present:
""Don't Fence Me In: Ecology and Free-Range and Fenced Ranching in Shane and Sea of Grass." Film and History
Conference. September 2012.
"The UPA and the Environment: A Modernist Look at Urban Nature." Popular Culture Association Conference. April
2012. Boston, MA.
"A West and a Western that Works?" Popular Culture Association Conference. April 2012. Boston, MA.
"Rankin Rankin/Bass Studios, Nature, and the Supernatural: Where Technology Serves and Destroys." Embarras Valley
Film Festival. EIU. November 2011.
"We're Eating Flipper?: Documenting Animal Rights and Environmental Ethics at Sea." July 22, 2011. Rachel Carson
Center Moving Environments Workshop. Munich, Germany. Teleconference.
"We're Eating Flipper?" Association for the Study of Literature and the Environment Conference. June 2011.
Bloomington, Indiana.
"Silent Film in Illinois." Embarras Valley Film Festival. November 2010.
"From Snow White to Lady and the Tramp: What Walt Disney Does for the Animal Rights Movement." Graphic
Engagement Conference. Purdue. September 2010.
"That's All Folks?: The Greening of Animated Film Production." Association of Environmental Studies and Sciences, Lewis and Clark College, Portland, OR. June 2010.
"Mountaintop Removal Documentaries: Environmental Externalities Or Hope?." Popular Culture Conference. St.
Louis, MO. April 2010.
"The Oil Wells of Baku: The First Eco-Disaster Film?" Cinema and Climate Change Conference. University College of
London (via weblink). December 2009.
"Bambi and Mr. Bug Goes to Town: Nature With or Without Us." English Department Colloquium. October 2009.
"Ecology and Specacle in Oil Wells of Baku: Close View: The First Eco-Disaster Film?" Cinema and Climate Change
Conference. London, UK. December 11, 2009. Teleconference.
"Cape Town Affair: Right Wing Noir, South African Style." The Annual International Crime, Media and Popular Culture
Studies Conference. Indiana State University. October, 2009.
"A New Look at Ecology and Popular Film: Cinema on the Edge." Association for the Study of Literature and the
Environment. Victoria, BC. June 2009.
Funding & GrantsGrants
National Writing Project SEED Leadership Grant 2014-16 ($20,000), continuing funding for Eastern Illinois Writing
Project and Institute Day.
National Writing Project SEED Professional Development Grant 2012 ($20,000), funding for high-need school
programs in Martinsville High School
National Writing Project SEED Leadership Grant 2013 ($20,000), continuing funding for Eastern Illinois Writing
Project and Institute Day.
National Writing Project SEED Professional Development Grant 2012 ($20,000), funding for high-need school
programs in Sullivan High School.
National Writing Project SEED Leadership Grant 2012 ($20,000), continuing funding for Eastern Illinois Writing
Project and Institute Day.
Coles County Arts Council grant to Central Illinois Feminist Film Festival 2012 ($250).
National Writing Project Grant: 2011 ($35,000) continuing funding for Eastern Illinois Writing Project.
National Writing Project Grant: 2010 ($47,000) continuing funding for Eastern Illinois Writing Project.
National Writing Project Grant: 2009 ($46,000) funding our Eastern Illinois Writing Project.
National Writing Project Site Grant: 2008 ($30,000) funding our Eastern Illinois Writing Project.
Illinois Arts Council Grant, 2009: Funding for Embarras Valley Film Festival.
EIU Summer Research Grants: 2009, 2008, 2000, 1999.
Redden Grant: 2008 for Film Studies Minor
Faculty Development Travel Awards and College of Arts and Humanities Travel Awards: Various semesters. 1998-pres.
Oklahoma Humanities Council Grants: 1997 and 1998.


text:
Information on the Personnel Structure Model (PSM) 185
The tasks and capabilities of the Bundeswehr are to be adapted to the security policy parameters (Source: Bundeswehr/Wilke)
Berlin, 21.09.2012.
The reorientation of the Bundeswehr calls for a restructuring of personnel to create mission-oriented all-volunteer armed forces and, at the same time, to achieve a reduction in strength. The Personnel Structure Model 185 implements the reorientation objectives for the body of military personnel.
Reorientation of the Bundeswehr: The Implementation Plans
Berlin, 12.06.2012.
With the implementation plans, an important step has been taken towards putting the Stationing Concept of the Bundeswehr into practice. The Federal Ministry of Defence adopted the new target structure already in April 2012. The timelines for the restructuring of the services and major organisational elements can be seen below.
Reorientation of the Bundeswehr: Implementation Plans


text:
An Ohio man was strolling through a thrift store when he saw a framed poster with Picasso scribbled on it. He bought it for $14.14. The Columbus Dispatch reports an auction house confirmed it was an original design carved by Picasso making the poster worth $6,000.
View the discussion thread.


text:
Oscars 2013: Why Was Kristen Stewart on Crutches and Limping?
Kristen Stewart has foot problems — and they aren't just of the foot-in-her-mouth variety!
The 22-year-old star showed up on the 2013 Oscars red carpet on February 24 in a gorgeous, flowing Reem Acra gown and a very unlikely accessory — crutches. She ditched them for her awards presentation with Daniel Radcliffe, but limped her way up to the mic. We also noticed a bruise on her arm. So what happened to the Twilight actress this time?
Kristen's makeup artist, Beau Nelson, told People she "cut the ball of her foot, quite severely, on glass two days ago."
For those who are interested, here's the history of Kristen's foot problems: Back in November 2011, Kristen was seen limping in her Jimmy Choo shoes at the premiere of The Twilight Saga: Breaking Dawn - Part 1. She said her injury was from a stunt on the set of Snow White and the Huntsman. In May 2012, Kristen limped her way onto Jimmy Kimmel Live! talking about an injury she suffered during reshoots of Breaking Dawn - Part 2.
Kristen was again spotted limping at Saturday's rehearsals for the 2013 Oscars ceremony.
KStew showed up at the Oscars sans on-again, off-again boytoy Robert Pattinson, so someone should've sent Bradley Cooper over to help her. We hear he has a thing for feet.
Source: People


text:
PIKEVILLE — The federal lawsuit against Eric C. Conn could eventually have implications for some of his Social Security clients, but those individual cases are not up for scrutiny in current case, which was filed against the well-known Floyd County lawyer and an administrative law judge who acted as his alleged rubber stamp.
According to a complaint filed in 2011 in United States District Court in Pikeville, and which only became public Tuesday, the plaintiffs are seeking to recover fraudulently obtained disability benefits and attorney's fees paid by the government to Eric C. Conn and Eric Conn P.S.C.
In the complaint, the attorneys for the United States state that these claims originate from a fraudulent scheme coordinated between Conn and Social Security ALJ David B. Daugherty, and involved Daugherty wrongfully taking control of a large number of Conn's Social Security cases "from randomly assigned administrative law judges and conducting sham proceedings, resulting in the Conn clients overwhelmingly and fraudulently obtaining successful rates."
During 2010, Daugherty approved 99.7 percent of all Social Security claims, while the national average was 62 percent.
According to SSA guidelines, because disability causes developed such large practices, a requirement was instituted that such cases be randomly assigned to administrative law judges on a rotating schedule, in order to prevent attorneys and ALJs from developing "too cooperative a relationship."
In an interview with The Floyd County Times, Benjamin Vernia, counsel for the plaintiffs, said he could not forecast whether or not individual claims made through the Conn/Daugherty hearings would be affected.
"That's an interesting question," Vernia said. "I'm not sure how that's going to work out. Conn and Daugherty are jointly responsible. We don't need to bring in claimants to get a judgment against the defendants.
"That's really a matter for the Social Security system. Our concern is the corruption of the process, and not whether a specific claim needs to be reopened or not."
Officials with the Social Security Administration, Office of Inspector General, had not responded to requests as of press time on how a potential judgment against Conn and Daugherty might affect the claims.
According to the complaint, Daugherty allegedly sought out and took control of the Conn claims which were not assigned to him by removing files from the desks of other ALJs, clerks, and the master docket cabinets. Also stated in the claim is that Daugherty routinely scheduled as many as 20 of Conn's claims a day for on-the-record hearings at 10-minute intervals.
In 2010, Daugherty reviewed 1,284 cases and granted benefits to all but four.
Daugherty and Conn's relationship was brought to light in a 2011 Wall Street Journal article, and Daugherty himself was noted in a recent U.S. Senate investigative report into Social Security disability programs.
In the report, it stated that the committee found that there was significant stress being put on the Disability Trust Fund due partly to the fact that "the number of individuals receiving disability benefits continues to rise at an unprecedented rate."
Daugherty was among those cited in the report. Daugherty retired in June 2011.
In a statement released to The Times, Conn briefly states that, "It is noteworthy that the U.S. government studied this lawsuit for a year-and-a-half and decided not to join it or get involved."
On his firm's website, Conn ties his commitment to integrity and ethics to his military career: "As a combat veteran and former U.S. Army captain, honor and integrity are important parts of my practice."
In 2009, Conn lobbied the administration of newly-elected President Barack Obama to be made the czar of the Social Security Administration.
The lawsuit was filed in October 2011. According to Vernia, the federal judge in the case found that only three documents contained information that should remained sealed. The United States has until March 1 to file any further motions to keep the remaining documents sealed.
Vernia said that when a case like this is filed, it is routine to have discussions with the U.S. Attorney General's office regarding any potential future criminal charges, but stated that he could not comment on those discussions.


text:
Ruby on Rails Tutorial
Learn Rails by Example
Michael Hartl
- Chapter 1 From zero to deploy
- 1.1 Introduction
- 1.2 Up and running
- 1.3 Version control with Git
- 1.4 Deploying
- 1.5 Conclusion
- Chapter 2 A demo app
- 2.1 Planning the application
- 2.2 The Users resource
- 2.3 The Microposts resource
- 2.4 Conclusion
- Chapter 3 Mostly static pages
- 3.1 Static pages
- 3.2 Our first tests
- 3.3 Slightly dynamic pages
- 3.4 Conclusion
- 3.5 Exercises
- Chapter 4 Rails-flavored Ruby
- 4.1 Motivation
- 4.2 Strings and methods
- 4.3 Other data structures
- 4.4 Ruby classes
- 4.5 Exercises
- Chapter 5 Filling in the layout
- Chapter 6 Modeling and viewing users, part I
- 6.1 User model
- 6.2 User validations
- 6.3 Viewing users
- 6.4 Conclusion
- 6.5 Exercises
- Chapter 7 Modeling and viewing users, part II
- 7.1 Insecure passwords
- 7.2 Secure passwords
- 7.3 Better user views
- 7.4 Conclusion
- 7.5 Exercises
- Chapter 8 Sign up
- 8.1 Signup form
- 8.2 Signup failure
- 8.3 Signup success
- 8.4 RSpec integration tests
- 8.5 Conclusion
- 8.6 Exercises
- Chapter 9 Sign in, sign out
- 9.1 Sessions
- 9.2 Signin failure
- 9.3 Signin success
- 9.4 Signing out
- 9.5 Conclusion
- 9.6 Exercises
- Chapter 10 Updating, showing, and deleting users
- 10.1 Updating users
- 10.2 Protecting pages
- 10.3 Showing users
- 10.4 Destroying users
- 10.5 Conclusion
- 10.6 Exercises
- Chapter 11 User microposts
- 11.1 A Micropost model
- 11.2 Showing microposts
- 11.3 Manipulating microposts
- 11.4 Conclusion
- 11.5 Exercises
- Chapter 12 Following users
- 12.1 The Relationship model
- 12.2 A web interface for following and followers
- 12.3 The status feed
- 12.4 Conclusion
- 12.5 Exercises
My former company (CD Baby) was one of the first to loudly switch to Ruby on Rails, and then even more loudly switch back to PHP (Google me to read about the drama). This book by Michael Hartl came so highly recommended that I had to try it, and Ruby on Rails Tutorial is what I used to switch back to Rails again.
Though I've worked my way through many Rails books, this is the one that finally made me "get" it. Everything is done very much "the Rails way"—a way that felt very unnatural to me before, but now after doing this book finally feels natural. This is also the only Rails book that does test-driven development the entire time, an approach highly recommended by the experts but which has never been so clearly demonstrated before. Finally, by including Git, GitHub, and Heroku in the demo examples, the author really gives you a feel for what it's like to do a real-world project. The tutorial's code examples are not in isolation.
The linear narrative is such a great format. Personally, I powered through Rails Tutorial in three long days, doing all the examples and challenges at the end of each chapter. Do it from start to finish, without jumping around, and you'll get the ultimate benefit.
Derek Sivers (sivers.org)
Formerly: Founder, CD Baby
Currently: Founder, Thoughts Ltd.
Ruby on Rails Tutorial owes a lot to my previous Rails book, RailsSpace, and hence to my coauthor Aurelius Prochazka. I'd like to thank Aure both for the work he did on that book and for his support of this one. I'd also like to thank Debra Williams Cauley, my editor on both RailsSpace and Rails Tutorial; as long as she keeps taking me to baseball games, I'll keep writing books for her.
I'd like to acknowledge a long list of Rubyists who have taught and inspired me over the years: David Heinemeier Hansson, Yehuda Katz, Carl Lerche, Jeremy Kemper, Xavier Noria, Ryan Bates, Geoffrey Grosenbach, Peter Cooper, Matt Aimonetti, Gregg Pollack, Wayne E. Seguin, Amy Hoy, Dave Chelimsky, Pat Maddox, Tom Preston-Werner, Chris Wanstrath, Chad Fowler, Josh Susser, Obie Fernandez, Ian McFarland, Steven Bristol, Giles Bowkett, Evan Dorn, Long Nguyen, James Lindenbaum, Adam Wiggins, Tikhon Bernstam, Ron Evans, Wyatt Greene, Miles Forrest, the good people at Pivotal Labs, the Heroku gang, the thoughtbot guys, and the GitHub crew. Finally, many, many readers—far too many to list—have contributed a huge number of bug reports and suggestions during the writing of this book, and I gratefully acknowledge their help in making it as good as it can be.
About the author
Michael Hartl is a programmer, educator, and entrepreneur. Michael was coauthor of RailsSpace, a best-selling Rails tutorial book published in 2007, and was cofounder and lead developer of Insoshi, a popular social networking platform in Ruby on Rails. Previously, he taught theoretical and computational physics at the California Institute of Technology (Caltech), where he received the Lifetime Achievement Award for Excellence in Teaching. Michael is a graduate of Harvard College, has a Ph.D. in Physics from Caltech, and is an alumnus of the Y Combinator program.
Copyright and license
Ruby on Rails Tutorial: Learn Rails by Example. Copyright © 2010 by Michael Hartl. All source code in Ruby on Rails Tutorial is available under the MIT License and the Beerware License.
Copyright (c) 2010 Michael Hartl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
/* * --------------------------------------------------------------------------- * "THE BEERWARE LICENSE" (Revision 42): * Michael Hartl wrote this code. As long as you retain this notice, you can * do whatever you want with this stuff. If we meet someday, and you think * this stuff is worth it, you can buy me a beer in return. * --------------------------------------------------------------------------- */
Chapter 1 From zero to deploy
Welcome to Ruby on Rails Tutorial: Learn Rails by Example. The goal of this book is to be the best and most up-to-date answer to the question, "If I want to learn web development with Ruby on Rails, where should I start?"1 Although the Ruby on Rails web framework benefits from a wealth of learning resources—including books, blogs, and screencasts—many of them assume a substantial background in Rails. Ruby on Rails Tutorial is designed to give you this background. By the time you finish this book, you will have a solid foundation in Rails programming, ready to benefit from more advanced Rails resources.
Ruby on Rails Tutorial follows essentially the same approach as my previous Rails book,2 teaching web development with Rails by building a sample application from scratch. This allows you to see the many different pieces of Ruby on Rails in context, motivated by real problems, as well as how those pieces fit together. Moreover, although Rails is a large and fast-moving framework, in Ruby on Rails Tutorial we'll focus on the smaller, more stable set of core Rails techniques that have crystallized in the last couple years, so the knowledge you gain here will not soon be obsolete. We'll also take care not to rely on the generated code called scaffolding (Box 1.1), so that the Rails knowledge you gain will be adaptable to new problems.
In this chapter, we'll get started with Ruby on Rails by installing all the necessary software and setting up our development environment (Section 1.2). We'll then create our first Rails application, called (appropriately enough) first_app. Rails Tutorial emphasizes good software development practices, so immediately after creating our fresh new Rails project we'll put it under version control with Git (Section 1.3). And, believe it or not, in this chapter we'll even put our first app on the wider web by deploying it to production (Section 1.4).
In Chapter 2, we'll make a second project, whose purpose will be to demonstrate the basic workings of a Rails application. To get up and running quickly, we'll build this demo app (called demo_app) using scaffolding to generate code; since this code is both ugly and complex, Chapter 2 will focus on interacting with the demo app through its URLs3 using a web browser.
In Chapter 3, we'll create a sample application (called sample_app), this time writing all the code from scratch. We'll develop the sample app using test-driven development (TDD), getting started in Chapter 3 by creating static pages and then adding a little dynamic content. We'll take a quick detour in Chapter 4 to learn a little about the Ruby language underlying Rails. Then, in Chapter 5 through Chapter 10, we'll complete the foundation for the sample application by making a site layout, a user data model, and a full registration and authentication system. Finally, in Chapter 11 and Chapter 12 we'll add microblogging and social features to make a working example site.
The final sample application will bear more than a passing resemblance to a certain popular social microblogging site—a site which, coincidentally, is also written in Rails. Though of necessity our efforts will focus on this specific sample application, the emphasis throughout Rails Tutorial will be on general principles, so that you will have a solid foundation no matter what kinds of web applications you want to build.
From the beginning, Rails has benefited from a palpable sense of excitement, starting with the famous 15-minute weblog video by Rails creator David Heinemeier Hansson, now updated as the 15-minute weblog using Rails 2 by Ryan Bates. These videos are a great way to get a taste of Rails' power, and I recommend watching them. But be warned: they accomplish their amazing fifteen-minute feat using a feature called scaffolding, which relies heavily on generated code, magically created by the Rails
generate command.
When writing a Ruby on Rails tutorial, it is tempting to rely on the scaffolding approach—it's quicker, easier, more seductive. But the complexity and sheer amount of code in the scaffolding can be utterly overwhelming to a beginning Rails developer; you may be able to use it, but you probably won't understand it. Following the scaffolding approach risks turning you into a virtuoso script generator with little (and brittle) actual knowledge of Rails.
In Rails Tutorial, we'll take the (nearly) polar opposite approach: although Chapter 2 will develop a small demo app using scaffolding, the core of Rails Tutorial is the sample app, which we'll start writing in Chapter 3. At each stage of developing the sample application, we will generate small, bite-sized pieces of code—simple enough to understand, yet novel enough to be challenging. The cumulative effect will be a deeper, more flexible knowledge of Rails, giving you a good background for writing nearly any type of web application.
1.1 Introduction
Since its debut in 2004, Ruby on Rails has rapidly become one of the most powerful and popular frameworks for building dynamic web applications. Rails users run the gamut from scrappy startups to huge companies: Posterous, UserVoice, 37signals, Shopify, Scribd, Twitter, Hulu, the Yellow Pages—the list of sites using Rails goes on and on. There are also many web development shops that specialize in Rails, such as ENTP, thoughtbot, Pivotal Labs, and Hashrocket, plus innumerable independent consultants, trainers, and contractors.
What makes Rails so great? First of all, Ruby on Rails is 100% open-source, available under the permissive MIT License, and as a result it also costs nothing to download and use. Rails also owes much of its success to elegant and compact design; by exploiting the malleability of the underlying Ruby language, Rails effectively creates a domain-specific language for writing web applications. As a result, many common web programming tasks—such as generating HTML, making data models, and routing URLs—are easy with Rails, and the resulting application code is concise and readable.
Rails also adapts rapidly to new developments in web technology and framework design. For example, Rails was one of the first frameworks to fully digest and implement the REST architectural style for structuring web applications (which we'll be learning about throughout this tutorial). And when other frameworks develop successful new techniques, Rails creator David Heinemeier Hansson and the Rails core team don't hesitate to incorporate their ideas. Perhaps the most dramatic example is the merger of Rails and Merb, a rival Ruby web framework, so that Rails now benefits from Merb's modular design, stable API, and improved performance.4 (Anyone who has attended a talk by Merb developer and Rails core team member Yehuda Katz can't help but notice what an extremely good idea it was to bring the Merb team on board.)
Finally, Rails benefits from an unusually enthusiastic and diverse community. The results include hundreds of open-source contributors, well-attended conferences, a huge number of plugins and gems (self-contained solutions to specific problems such as pagination and image upload), a rich variety of informative blogs, and a cornucopia of discussion forums and IRC channels. The large number of Rails programmers also makes it easier to handle the inevitable application errors: the "Google the error message" algorithm nearly always produces a relevant blog post or discussion-forum thread.
1.1.1 Comments for various readers
Rails Tutorial contains integrated tutorials not only for Rails, but also for the underlying Ruby language, as well as for HTML, CSS, some JavaScript, and even a little SQL. This means that, no matter where you currently are in your knowledge of web development, by the time you finish this tutorial you will be ready for more advanced Rails resources, as well as for the more systematic treatments of the other subjects mentioned.
Rails derives much of its power from "magic"—that is, framework features (such as automatically inferring object attributes from database columns) that accomplish miracles but whose mechanisms can be rather mysterious. Ruby on Rails Tutorial is not designed to explain this magic—mainly because most Rails application developers never need to know what's behind the curtain. (After all, Ruby itself is mostly written in C, but you don't have to dig into the C source to use Ruby.) If you're a confirmed pull-back-the-curtain kind of person, I recommend The Rails Way by Obie Fernandez as a companion volume to Rails Tutorial.
Although this book has no formal prerequisites, you should of course have at least some computer experience. If you've never even used a text editor before, it will be tough going, but with enough determination you can probably soldier through. If, on the other hand, your
.emacs file is so complex it could make a grown man cry, there is still plenty of material to keep you challenged. Rails Tutorial is designed to teach Rails development no matter what your background is, but your path and reading experience will depend on your particular circumstances.
All readers: One common question when learning Rails is whether to learn Ruby first. The answer depends on your personal learning style. If you prefer to learn everything systematically from the ground up, then learning Ruby first might work well for you, and there are several book recommendations in this section to get you started. On the other hand, many beginning Rails developers are excited about making web applications, and would rather not slog through a 500-page book on pure Ruby before ever writing a single web page. Moreover, the subset of Ruby needed by Rails developers is different from what you'll find in a pure-Ruby introduction, whereas Rails Tutorial focuses on exactly that subset. If your primary interest is making web applications, I recommend starting with Rails Tutorial and then reading a book on pure Ruby next. It's not an all-or-nothing proposition, though: if you start reading Rails Tutorial and feel your (lack of) Ruby knowledge holding you back, feel free to switch to a Ruby book and come back when you feel ready. You might also consider getting a taste of Ruby by following a short online tutorial, such as can be found at http://www.ruby-lang.org/ or http://rubylearning.com/.
Another common question is whether to use tests from the start. As noted in the introduction, Rails Tutorial uses test-driven development (also called test-first development), which in my view is the best way to develop Rails applications, but it does introduce a substantial amount of overhead and complexity. If you find yourself getting bogged down by the tests, feel free to skip them on first reading.5 Indeed, some readers may find the inclusion of so many moving parts—such as tests, version control, and deployment—a bit overwhelming at first, and if you find yourself expending excessive energy on any of these steps, don't hesitate to skip them. Although I have included only material I consider essential to developing professional-grade Rails applications, only the core application code is strictly necessary the first time through.
Inexperienced programmers (non-designers): Rails Tutorial doesn't assume any background other than general computer knowledge, so if you have limited programming experience this book is a good place to start. Please bear in mind that it is only the first step on a long journey; web development has many moving parts, including HTML/CSS, JavaScript, databases (including SQL), version control, and deployment. This book contains short introductions to these subjects, but there is much more to learn.
Inexperienced programmers (designers): Your design skills give you a big leg up, since you probably already know HTML and CSS. After finishing this book you will be in an excellent position to work with existing Rails projects and possibly start some of your own. You may find the programming material challenging, but the Ruby language is unusually friendly to beginners, especially those with an artistic bent.
After finishing Ruby on Rails Tutorial, I recommend that newer programmers read Beginning Ruby by Peter Cooper, which shares the same basic instructional philosophy as Rails Tutorial. I also recommend The Ruby Way by Hal Fulton. Finally, to gain a deeper understanding of Rails I recommend The Rails Way6 by Obie Fernandez.
Web applications, even relatively simple ones, are by their nature fairly complex. If you are completely new to web programming and find Rails Tutorial overwhelming, it could be that you're not quite ready to make web applications yet. In that case, I'd suggest learning the basics of HTML and CSS and then giving Rails Tutorial another go. (Unfortunately, I don't have a personal recommendation here, but Head First HTML looks promising, and one reader recommends CSS: The Missing Manual by David Sawyer McFarland.) You might also consider reading the first few chapters of Beginning Ruby, which starts with sample applications much smaller than a full-blown web app.
Experienced programmers new to web development: Your previous experience means you probably already understand ideas like classes, methods, data structures, etc., which is a big advantage. Be warned that if your background is in C/C++ or Java, you may find Ruby a bit of an odd duck, and it might take time to get used to it; just stick with it and eventually you'll be fine. (Ruby even lets you put semicolons at the ends of lines if you miss them too much.) Rails Tutorial covers all the web-specific ideas you'll need, so don't worry if you don't currently know a PUT from a POST.
Experienced web developers new to Rails: You have a great head start, especially if you have used a dynamic language such as PHP or (even better) Python. The basics of what we cover will likely be familiar, but test-driven development may be new to you, as may be the structured REST style favored by Rails. Ruby has its own idiosyncrasies, so those will likely be new, too.
Experienced Ruby programmers: The set of Ruby programmers who don't know Rails is a small one nowadays, but if you are a member of this elite group you can fly through this book and then move on to The Rails Way by Obie Fernandez.
Inexperienced Rails programmers: You've perhaps read some other tutorials and made a few small Rails apps yourself. Based on reader feedback, I'm confident that you can still get a lot out of this book. Among other things, the techniques here may be more up-to-date than the ones you picked up when you originally learned Rails.
Experienced Rails programmers: This book is unnecessary for you, but many experienced Rails developers have expressed surprise at how much they learned from this book, and you might enjoy seeing Rails from a different perspective.
After finishing Ruby on Rails Tutorial, I recommend that experienced (non-Ruby) programmers read The Well-Grounded Rubyist by David A. Black, which is an excellent in-depth discussion of Ruby from the ground up, or The Ruby Way by Hal Fulton, which is also fairly advanced but takes a more topical approach. Then move on to The Rails Way to deepen your Rails expertise.
At the end of this process, no matter where you started, you will be ready for the more intermediate-to-advanced Rails resources. Here are some I particularly recommend:
- Railscasts: Excellent free Rails screencasts
- PeepCode, Pragmatic.tv, EnvyCasts: Excellent commercial screencasters
- Rails Guides: Good topical and up-to-date Rails references. Rails Tutorial refers frequently to the Rails Guides for more in-depth treatment of specific topics.
- Rails blogs: Too many to list, but there are tons of good ones.
1.1.2 "Scaling" Rails
Before moving on with the rest of the introduction, I'd like to take a moment to address the one issue that dogged the Rails framework the most in its early days: the supposed inability of Rails to "scale"—i.e., to handle large amounts of traffic. Part of this issue relied on a misconception; you scale a site, not a framework, and Rails, as awesome as it is, is only a framework. So the real question should have been, "Can a site built with Rails scale?" In any case, the question has now been definitively answered in the affirmative: some of the most heavily trafficked sites in the world use Rails. Actually doing the scaling is beyond the scope of just Rails, but rest assured that if your application ever needs to handle the load of Hulu or the Yellow Pages, Rails won't stop you from taking over the world.
1.1.3 Conventions in this book
The conventions in this book are mostly self-explanatory; in this section I'll mention some that may not be. First, both the HTML and PDF editions of this book are full of links, both to internal sections (such as Section 1.2) and to external sites (such as the main Ruby on Rails download page).7
Second, your humble author is a Linux/OS X kind of guy, and hasn't used Windows as his primary OS for more than a decade; as a result, Rails Tutorial has an unmistakable Unix flavor.8 For example, in this book all command line examples use a Unix-style command line prompt (a dollar sign):
$ echo "hello, world"
hello, world
Rails comes with lots of commands that can be run directly under Unix but often require an explicit call to the Ruby interpreter under Windows;9 for example, in Section 1.2.5 we'll run a local development web server as follows:
# Unix (Linux, OS X, etc.)
$ script/server
# Windows (explicitly uses the Ruby interpreter)
> ruby script/server
Rails Tutorial will also use Unix-style forward slashes as directory separators; my Rails Tutorial sample app, for instance, lives in
The root directory for any given app is known as the Rails root, and henceforth all directories will be relative to this directory. For example, the
config directory of my sample application is in
This means that when referring to the file
I'll omit the Rails root and write
config/routes.rb for brevity.
Finally, Rails Tutorial often shows output from various programs (shell commands, version control status, Ruby programs, etc.); because of the innumerable small differences between different computer systems, the output you see may not always agree exactly with what is shown in the text. This is normal, and is not any cause for concern. As long as the application pages load and the test suite passes, you're good to go.
1.2 Up and running
It's time now to get going with a Ruby on Rails development environment and our first application. There is quite a bit of overhead here, especially if you don't have extensive programming experience, so don't get discouraged if it takes a while to get started. It's not just you; every developer goes through it (often more than once), but rest assured that the effort will be richly rewarded.
1.2.1 Development environments
Considering various idiosyncratic customizations, there are probably as many development environments as there are Rails programmers, but there are at least two broad themes: text editor/command line environments, and integrated development environments (IDEs). Let's consider the latter first.
There is no shortage of Rails IDEs; indeed, the main Ruby on Rails site names four: RadRails, RubyMine, 3rd Rail, and NetBeans. All are cross-platform, and I've heard good things about several of them. I encourage you to try them and see if they work for you, but I have a confession to make: I have never found an IDE that met all my Rails development needs—and for some projects I haven't even been able to get them to work at all.
Text editors and command lines
What are we to use to develop Rails apps, if not some awesome all-in-one IDE? I'd guess the majority of Rails developers opt for the same solution I've chosen: use a text editor to edit text, and a command line to issue commands (Figure 1.1). Which combination you use depends on your tastes and your platform:
- Macintosh OS X: Like many Rails developers, I prefer TextMate. Other options include Emacs and MacVim (launched with the command
macvim), the excellent Macintosh version of Vim.10 I use iTerm for my command line terminal; others prefer the native Terminal app.
- Linux: Your editor options are basically the same as OS X, minus TextMate. I'd recommend graphical Vim (gVim), gedit (with the GMate plugins), or Kate. As far as command lines go, you're totally set: every Linux distribution comes with at least one command line terminal application (and often several).
- Windows: Unfortunately, I can't make any personal recommendations here, but you can do what I did: drop "rails windows" into Google to see what the latest thinking is on setting up a Rails development environment on Windows. Two combinations look especially promising: Vim for Windows with Console (recommended by Akita On Rails) or the E Text Editor with Console and Cygwin (recommended by Ben Kittrell). Rails Tutorial readers have suggested looking at Komodo Edit (cross-platform) and the Sublime Text editor (Windows only) as well. No matter which editor you choose, I recommend trying Cygwin, which provides the equivalent of a Unix terminal under Windows; see, for example, this video on Ruby on Rails + Cygwin + Windows Vista. (In addition to installing the packages in the video, I recommend installing git, curl, and vim. Don't install Rails as in the video, though; use the instructions below instead.) With Cygwin, most of the command-line examples in the book should work with minimum modification.
If you go with some flavor of Vim, be sure to tap into the thriving community of Vim-using Rails hackers. See especially the rails.vim enhancements and the NERD tree project drawer.
Although there are many web browsers to choose from, the vast majority of Rails programmers use Firefox, Safari, or Chrome when developing. The screenshots in Rails Tutorial will generally be of a Firefox browser. If you use Firefox, I suggest using the Firebug add-on, which lets you perform all sorts of magic, such as dynamically inspecting (and even editing) the HTML structure and CSS rules on any page. For those not using Firefox, Firebug Lite works with most other browsers, and both Safari and Chrome have a built-in "Inspect element" feature available by right-clicking on any part of the page. Regardless of which browser you use, experience shows that the time spent learning such a web inspector tool will be richly rewarded.
I also recommend the Firefox HTML Validator, which automatically checks to make sure that your pages are valid HTML markup.11 (If you install Validator, you should go to the add-on Preferences to disable it for all pages, and then visit
localhost and explicitly enable it for local pages. Otherwise it will try to validate every page you visit.) Figure 1.2 shows both add-ons in action.
A note about tools
In the process of getting your development environment up and running, you may find that you spend a lot of time getting everything just right. The learning process for editors and IDEs is particularly long; you can spend weeks on TextMate or Vim tutorials alone. If you're new to this game, I want to assure you that spending time learning tools is normal. Everyone goes through it. Sometimes it is frustrating, and it's easy to get impatient when you have an awesome web app in your head and you just want to learn Rails already, but have to spend a week learning some weird ancient Unix editor just to get started. But a craftsman has to know his tools; in the end the reward is worth the effort.
1.2.2 Ruby, RubyGems, and Rails
Now it's time to install Ruby and Rails. The canonical up-to-date source for this step is the Ruby on Rails download page. I'll assume you can go there now; parts of this book can be read profitably offline, but not this part. I'll just inject some of my own comments on the steps.
Install Ruby
It's possible that your system already has Ruby; try running
$ ruby -v
ruby 1.8.7
to see the version number. Rails 2.3.8 requires Ruby 1.8.7 or higher. (Ruby 1.9.1 is buggy, and Ruby 1.9.2 is in beta as of this writing, so this tutorial will assume that you are using Ruby 1.8.7. If you want to use Ruby 1.9.2, I recommend reading the Rails 3 version of this tutorial.)
If you have to install Ruby, I strongly recommend doing a search for "install ruby OS X 10.5" (or whatever is appropriate for your system), since there are tons of options depending on your exact setup. Be warned that installing Ruby might take some trickery. If you run into any errors, just Google them. If you plan to run Rails 3.0 on your system in addition to running Rails 2.3, I recommend installing Ruby Version Manager (RVM) and following the Ruby installation instructions in the Installing Ruby section of the Ruby on Rails 3 Tutorial book.
Note: If you're running Ubuntu Linux, at this point you might try these instructions for installing Rails on Karmic Koala rather than following the steps below.
Install RubyGems
RubyGems is a package manager for Ruby projects, and there are tons of great libraries (including Rails) available as Ruby packages, or gems. Installing RubyGems should be easy once you install Ruby. You should download RubyGems, extract/unzip it, and then go to the
rubygems directory and run the setup program:
$ [sudo] ruby setup.rb
sudo executes the command
ruby setup.rb as an administrative user, which has access to files and directories that normal users can't touch; I have put it in brackets to indicate that using
sudo may or may not be necessary for your particular system. Most Unix/Linux/OS X systems require
sudo by default, unless you are using RVM as suggested in Section 188.8.131.52. Note that you should not actually type any brackets; you should run either
$ sudo ruby setup.rb
$ ruby setup.rb
depending on your system.
If you already have RubyGems installed, you might want to update your system to the version needed in this tutorial:
$ [sudo] gem update --system 1.3.7
Install Rails
This part should be really easy once you install RubyGems:
$ [sudo] gem install rails -v 2.3.8
Here the optional version flag
-v just ensures that you get the exact version of Rails used in this tutorial.12 (Rails 3 is already in beta, and I will update the tutorial as soon as possible after its official release.)
To verify that this worked, run the following command:13
$ rails -v
Rails 2.3.8
1.2.3 The first application
Virtually all Rails applications start the same way, with the
rails command. This handy program creates a skeleton Rails application in a directory of your choice. To get started, make a directory for your Rails projects and then run the
rails command to make the first application:
rails script to generate a new application.
$ mkdir rails_projects
$ cd rails_projects
$ rails first_app
create app/controllers
create app/helpers
create app/models
create app/views/layouts
create config/environments
create config/initializers
create config/locales
create db
create doc
create lib
create lib/tasks
create log
create public/images
create public/javascripts
create public/stylesheets
Notice how many files and directories the
rails command creates. This standard directory and file structure (Figure 1.3) is one of the many advantages of Rails; it immediately gets you from zero to a functional (if minimal) application. Moreover, since the structure is common to all Rails apps, you can immediately get your bearings when looking at someone else's code. A summary of the default Rails files appears in Table 1.1; we'll learn about most of these files and directories throughout the rest of this book.
|Core application (app) code, including models, views, controllers, and helpers
|Application configuration
|Files to manipulate the database
|Documentation for the application
|Library modules
|Application log files
|Data accessible to the public (e.g., web browsers), including images and cascading style sheets (CSS)
|Scripts provided by Rails for generating code, opening console sessions, or starting a local web server
|Application tests (made obsolete by the spec/ directory in Section 3.2.1)
|Temporary files
|Third-party code such as plugins and gems
|A brief description of the application
|Utility tasks available via the
rake command
1.2.4 Model-view-controller (MVC)
Even at this early stage, it's helpful to get a high-level overview of how Rails applications work (Figure 1.4). You might have noticed that the standard Rails application structure (Figure 1.3) has an application directory called
app/ with three subdirectories:
views, and
controllers. This is a hint that Rails follows the model-view-controller (MVC) architectural pattern, which enforces a separation between "domain logic" (also called "business logic") from the input and presentation logic associated with a graphical user interface (GUI). In the case of web applications, the "domain logic" typically consists of data models for things like users, articles, and products, and the GUI is just a web page in a web browser.
When interacting with a Rails application, a browser sends a request, which is received by a web server and passed on to a Rails controller, which is in charge of what to do next. In some cases, the controller will immediately render a view, which is a template that gets converted to HTML and sent back to the browser. More commonly for dynamic sites, the controller interacts with a model, which is a Ruby object that represents an element of the site (such as a user) and is in charge of communicating with the database. After invoking the model, the controller then renders the view and returns the complete web page to the browser as HTML.
If this discussion seems a bit abstract right now, worry not; we'll refer back to this section frequently. In addition, Section 2.2.2 has a more detailed discussion of MVC in the context of the demo app. Finally, the sample app will use all aspects of MVC; we'll cover controllers and views starting in Section 3.1.2, models starting in Section 6.1, and we'll see all three working together in Section 6.3.2.
Thanks to running
rails in Listing 1.1, we already have an application we can run—but how? Happily, Rails comes with a command-line program, or script, that runs a local web server,14 visible only from your development machine:15
$ cd first_app/
$ script/server
=> Booting WEBrick
=> Rails 2.3.8 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
This tells us that the application is running on port number 300016 at the address
0.0.0.0. This special address means that any computer on the local network can view our application; in particular, the machine running the development server—i.e., the local development machine—can view the application using the address
localhost:3000.17 We can see the result of visiting http://localhost:3000/ in Figure 1.5.
Unfortunately, we're not quite done; click on the link About your application's environment and you'll see your very first Rails error message18 (Figure 1.6). Looking in the web server log (Figure 1.7), we eventually see the incriminating lines:
Status: 500 Internal Server Error
no such file to load -- sqlite3
This is a hint that we're missing SQLite, the default database used by Rails. Even though we won't need a database until Chapter 6, since Rails is opinionated software it still expects a database to be installed, so let's take a few seconds to set it up. First, we need the SQLite gem for Ruby:
$ [sudo] gem install sqlite3-ruby -v 1.2.5
Building native extensions. This could take a while...
If you're running Linux you might get an error like this:
Building native extensions. This could take a while...
ERROR: Error installing sqlite3-ruby:
ERROR: Failed to build gem native extension.
In this case, install
sqlite3 and
libsqlite3-dev first:
$ [sudo] apt-get install sqlite3
$ [sudo] apt-get install libsqlite3-dev
$ [sudo] gem install sqlite3-ruby -v 1.2.5
Once you've installed SQLite, all that's left is to set up the (empty) database using Rake (Box 1.2):
$ rake db:migrate
This does nothing but create an empty SQLite database for now,19 but we'll see in Section 2.2.1 (and in more detail starting in Chapter 6) how to use
rake db:migrate to create a database for an application's data model.
Now hit Ctrl-C to quit the server, and then restart it with
script/server. You should see the result in Figure 1.8. Of course, we don't need the default Rails page in the long run, but it's nice to see it working for now. We'll remove the default Rails page (and replace it with a custom home page) in Section 5.2.2.
How would you know to install SQLite if I weren't here to tell you? The best bet is usually to drop the error message into Google (maybe with the word rails thrown in) and keep searching until you find an answer. If that doesn't work, emailing the Ruby on Rails mailing list is probably worth a try.
At this point, in principle you're ready to start developing your Rails application, so I suppose you could skip ahead to Chapter 3. On the other hand, it would be irresponsible of me not to very strongly recommend that you follow the rest of the chapter—especially the next section on version control. A couple years ago maybe you could get away with writing a Rails tutorial book without integrating version control from the start, but not any more.
In the Unix tradition, the make utility has played an important role in building executable programs from source code; many a computer hacker has committed to muscle memory the line
$ ./configure && make && sudo make install
commonly used to compile code on Unix systems (including Linux and Mac OS X).
Rake is Ruby make, a make-like language written in Ruby. Rails uses Rake extensively, especially for the innumerable little administrative tasks necessary when developing database-backed web applications. The
rake db:migrate command is probably the most common, but there are many others; you can see a list of database tasks using
-T db:
$ rake -T db
To see all the Rake tasks available, run
$ rake -T
The list is likely to be overwhelming, but don't worry, you don't have to know all (or even most) of these commands. By the end of Rails Tutorial, you'll know all the most important ones.
1.3 Version control with Git
Now that we have a fresh and working Rails application, we'll take a moment for a step that, while technically optional, would be viewed by many Rails developers as practically essential, namely, placing our application source code under version control.
Version control systems allow us to track changes to our project's code, collaborate more easily, and roll back any inadvertent errors (such as accidentally deleting files). There are many options for version control, but the Rails community has largely standardized on Git, a version control system originally developed by Linus Torvalds to host the Linux kernel. Git is a large subject, and we'll only be scratching the surface in this book, but there are many good free resources online; I especially recommend Pro Git by Scott Chacon (Apress, 2009).
Putting your source code under version control with Git is strongly recommended, not only because it's nearly a universal practice in the Rails world, but also because it will allow you to share your code more easily (Section 1.3.4) and deploy your application right here in the first chapter (Section 1.4).
1.3.1 Installation and setup
The first step is to install Git if you don't have it already. You should follow the instructions for your platform at the Installing Git section of Pro Git.
First-time system setup
After installing Git, you should perform a set of one-time setup steps. These are system setups, meaning you only have to do them once per computer:
$ git config --global user.name "Your Name"
$ git config --global user.email firstname.lastname@example.com
I also like to use
co in place of the more verbose
checkout command, which we can arrange as follows:
$ git config --global alias.co checkout
This tutorial will usually use the full
checkout command, which works for systems that don't have
co configured, but in real life I nearly always use
git co to check out a project.
As a final setup step, you can optionally set the editor Git will use for commit messages. If you use a graphical editor such as TextMate, gVim, or MacVim, you need to use a flag to make sure that the editor stays attached to the shell instead of detaching immediately:20
$ git config --global core.editor "mate -w"
"mate -w" with
"gvim -f" for gVim or
"mvim -f" for MacVim.
First-time repository setup
Now we come to some steps that are necessary each time you create a new repository (which only happens once in this book, but is likely to happen again some day). First navigate to the root directory of the first app and initialize a new repository:
$ git init
Initialized empty Git repository in /Users/mhartl/rails_projects/first_app/.git/
The next step is to add the project files to the repository. There's a minor complication, though: by default Git tracks the changes of all the files, but there are some files we don't want to track. For example, Rails creates log files to record the behavior of the application; these files change frequently, and we don't want our version control system to have to update them constantly. Git has a simple mechanism to ignore such files: simply include a file called
.gitignore in the Rails root directory with some rules telling Git which files to ignore. To ignore all log files, which live in the
log/ directory, we use the asterisk wildcard and ignore all files that end in
.log by including
log/*.log in
.gitignore (and so on for the other kinds of files we want Git to ignore). So, create a new
.gitignore file using your favorite editor:21
$ mate .gitignore
Then fill the file with the contents of Listing 1.2.
.gitignore file for a Rails project.
The lines in Listing 1.2 tell Git to ignore log files, Rails temp files, documentation files, SQLite databases, Vim and Emacs swap files, and (for you OS X users) the weird
.DS_Store directories created by the Mac Finder application. Don't worry if you wouldn't have guessed these lines; Understanding just why each of these file types should be ignored comes from having practical experience with both Rails and Git. By using this
.gitignore from the start, you can benefit immediately from the collective Git experience of the Rails community.
1.3.2 Adding and committing
Finally, we'll add the files in your new Rails project to Git and then commit the results. You can add all the files (apart from those that match the ignore patterns in
.gitignore) as follows:22
$ git add .
Here the dot '
.' represents the current directory, and Git is smart enough to add the files recursively, so it automatically includes all the subdirectories. This command adds the project files to a staging area, which contains pending changes to your project; you can see which files are in the staging area using the
status command:23
$ git status
# On branch master
# Initial commit
# Changes to be committed:
# (use "git rm --cached <file>..." to unstage)
# new file: README
# new file: Rakefile
(The results are long, so I've used vertical dots to indicate omitted output.)
To tell Git you want to keep the changes, use the
commit command:
$ git commit -m "Initial commit"
[master (root-commit) df0a62f] Initial commit
42 files changed, 8461 insertions(+), 0 deletions(-)
create mode 100644 README
create mode 100644 Rakefile
-m flag lets you add a message for the commit; if you omit
-m, Git will open the editor you set in Section 1.3.1 and have you enter the message there.
It is important to note that Git commits are local, recorded only on the machine on which the commits occur. This is in contrast to the popular open-source version control system called Subversion, in which a commit necessarily makes changes on a remote repository. Git divides a Subversion-style commit into its two logical pieces: a local recording of the changes (
git commit) and a push of the changes up to a remote repository (
git push). We'll see an example of the push step in Section 1.3.5.
By the way, you can see a list of your commit messages using the
log command:
$ git log
commit df0a62f3f091e53ffa799309b3e32c27b0b38eb4
Author: Michael Hartl <email@example.com>
Date: Thu Oct 15 11:36:21 2009 -0700
Initial commit
To exit
git log, you may have to type
q to quit.
1.3.3 What good does Git do you?
It's probably not entirely clear at this point why putting your source under version control does you any good, so let me give just one example. (We'll see many others in the chapters ahead.) Suppose you've made some accidental changes, such as (D'oh!) deleting the critical
app/controllers/ directory:
$ ls app/controllers/
$ rm -rf app/controllers/
$ ls app/controllers/
ls: app/controllers/: No such file or directory
Here we're using the Unix
ls command to list the contents of the
app/controllers/ directory and the
rm command to remove it. The
-rf flag means "recursive force", which recursively removes all files, directories, subdirectories, and so on, without asking for explicit confirmation of each deletion.
Let's check the status to see what's up:
$ git status
# On branch master
# Changed but not updated:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# deleted: app/controllers/application_controller.rb
no changes added to commit (use "git add" and/or "git commit -a")
We see here that a couple files have been deleted, but the changes are only on the "working tree"; they haven't been committed yet. This means we can still undo the changes easily by having Git check out the previous commit with the
checkout command (and a
-f flag to force overwriting the current changes):
$ git checkout -f
$ git status
# On branch master
nothing to commit (working directory clean)
$ ls app/controllers/
The missing directory and file are back. That's a relief!
1.3.4 GitHub
Now that you've put your project under version control with Git, it's time to push your code up to GitHub, a social code site optimized for hosting and sharing Git repositories. Putting a copy of your Git repository at GitHub serves two purposes: it's a full backup of your code (including the full history of commits), and it makes any future collaboration much easier. This step is optional, but being a GitHub member will open the door to participating in a wide variety of Ruby and Rails projects (GitHub has high adoption rates in the Ruby and Rails communities, and in fact is itself written in Rails).
GitHub has a variety of paid plans, but for open source code their services are free, so sign up for a free GitHub account if you don't have one already. (You might have to read about SSH keys first.) After signing up, you'll see a page like the one in Figure 1.9. Click on create a repository and fill in the information as in Figure 1.10. After submitting the form, push up your first application as follows:
$ git remote add origin firstname.lastname@example.com:<username>/first_app.git
$ git push origin master
These commands tell Git that you want to add GitHub as the origin for your main (master) branch and then push your repository up to GitHub. Of course, you should replace <username> with your actual username. For example, the command I ran for the
railstutorial user was
$ git remote add origin email@example.com:railstutorial/first_app.git
The result is a page at GitHub for the first application repository, with file browsing, full commit history, and lots of other goodies (Figure 1.11).
1.3.5 Branch, edit, commit, merge
If you've followed the steps in Section 1.3.4, you might notice that GitHub automatically shows the contents of the
README file on the main repository page. In our case, since the project is a Rails application generated using the
rails command, the
README file is the one that comes with Rails (Figure 1.12). This isn't very helpful, so in this section we'll make our first edit by changing the
README to describe our project rather than the Rails framework itself. In the process, we'll see a first example of the branch, edit, commit, merge workflow that I recommend using with Git.
Git is incredibly good at making branches, which are effectively copies of a repository where we can make (possibly experimental) changes without modifying the parent files. In most cases, the parent repository is the master branch, and we can create a new topic branch by using
checkout with the
-b flag:
$ git checkout -b modify-README
Switched to a new branch 'modify-README'
$ git branch
* modify-README
Here the second command,
git branch, just lists all the local branches, and the asterisk
* identifies which branch we're currently on. Note that
git checkout -b modify-README both creates a new branch and switches to it, as indicated by the asterisk in front of the
modify-README branch. (If you set up the
co alias in Section 1.3, you can use
git co -b modify-README instead.)
The full value of branching only becomes clear when working on a project with multiple developers,24 but branches are helpful even for a single-developer tutorial such as this one. In particular, the master branch is insulated from any changes we make to the topic branch, so even if we really screw things up we can always abandon the changes by checking out the master branch and deleting the topic branch. We'll see how to do this at the end of the section.
By the way, for a change as small as this one I wouldn't normally bother with a new branch, but it's never too early to start practicing good habits.
After creating the topic branch, we'll edit it to make it a little more descriptive. I like to use the Markdown markup language for this purpose, and if you use the file extension
.markdown then GitHub will automatically format it nicely for you. So, first we'll use Git's version of the Unix
mv ("move") command to change the name, and then fill it in with the contents of Listing 1.3:
$ git mv README README.markdown
$ mate README.markdown
README file,
# Ruby on Rails Tutorial: first application
This is the first application for
[*Ruby on Rails Tutorial: Learn Rails by Example*](http://www.railstutorial.org/)
by [Michael Hartl](http://www.michaelhartl.com/).
With the changes made, we can take a look at the status of our branch:
$ git status
# On branch modify-README
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
# renamed: README -> README.markdown
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
# modified: README.markdown
At this point, we could use
git add . as in Section 1.3.2, but Git provides the
-a flag as a shortcut for the (very common) case of committing all modifications to existing files (or files created using
git mv, which don't count as new files to Git):
$ git commit -a -m "Improved the README file"
2 files changed, 5 insertions(+), 243 deletions(-)
delete mode 100644 README
create mode 100644 README.markdown
Be careful about using the
-a flag improperly; if you have added any new files to the project since the last commit, you still have tell Git about them using
git add first.
Now that we've finished making our changes, we're ready to merge the results back into our master branch:25
$ git checkout master
Switched to branch 'master'
$ git merge modify-README
Updating 34f06b7..2c92bef
Fast forward
README.markdown | 5 +
2 files changed, 5 insertions(+), 243 deletions(-)
delete mode 100644 README
create mode 100644 README.markdown
Note that the Git output frequently includes things like
34f06b7, which are related to Git's internal representation of repositories. Your exact results will differ in these details, but otherwise should essentially match the output shown above.
After you've merged in the changes, you can tidy up your branches by deleting the topic branch using
git branch -d if you're done with it:
$ git branch -d modify-README
Deleted branch modify-README (was 2c92bef).
This step is optional, and in fact it's quite common to leave the topic branch intact. This way you can switch back and forth between the topic and master branches, merging in changes every time you reach a natural stopping point.
As mentioned above, it's also possible to abandon your topic branch changes, in this case with
git branch -D:
# For illustration only; don't do this unless you mess up a branch
$ git checkout -b topic-branch
$ <really screw up the branch>
$ git add .
$ git commit -a -m "Screwed up"
$ git checkout master
$ git branch -D topic-branch
Unlike the
-d flag, the
-D flag will delete the branch even though we haven't merged in the changes.
Now that we've updated the
README, we can push the changes up to GitHub to see the result:26
$ git push
As promised, GitHub nicely formats the new file using Markdown (Figure 1.13).
1.4 Deploying
Even at this early stage, we're already going to deploy our (still-empty) Rails application to production. This step is optional, but deploying early and often allows us to catch any deployment problems early in our development cycle. The alternative—deploying only after laborious effort sealed away in a development environment—often leads to terrible integration headaches when launch time comes.27
Deploying Rails applications used to be a pain, but the Rails deployment ecosystem has matured rapidly in the past few years, and now there are several great options. These include shared hosts or virtual private servers running Phusion Passenger (a module for the Apache and Nginx28 web servers), full-service deployment companies such as Engine Yard and Rails Machine, and cloud deployment services such as Engine Yard Cloud and Heroku.
My favorite Rails deployment option is Heroku, which is a hosted platform built specifically for deploying Rails and other Ruby web applications.29 Heroku makes deploying Rails applications ridiculously easy—as long as your source code is under version control with Git. (This is yet another reason to follow the Git setup steps in Section 1.3 if you haven't already.) The rest of this section is dedicated to deploying our first application to Heroku.
1.4.1 Heroku setup
After signing up for a Heroku account, install the Heroku gem:
$ [sudo] gem install heroku
As with GitHub (Section 1.3.4), when using Heroku you will need to create SSH keys if you haven't already, and then tell Heroku your public key so that you can use Git to push the sample application repository up to their servers:
$ heroku keys:add
Finally, use the
heroku gem to create a place on the Heroku servers for the sample app to live (Listing 1.4).
$ heroku create
Created http://severe-fire-61.heroku.com/ | firstname.lastname@example.com:severe-fire-61.git
Git remote heroku added
Yes, that's it. The
heroku gem creates a new subdomain just for our application, available for immediate viewing. There's nothing there yet, though, so let's get busy deploying.
1.4.2 Heroku deployment, step one
To deploy to Heroku, the first step is to use Git to push the application to Heroku:
$ git push heroku master
1.4.3 Heroku deployment, step two
There is no step two! We're already done (Figure 1.14).
To see your newly deployed application, you can visit the address that you saw when you ran
heroku create (i.e., Listing 1.4, but with the address for your app, not the address for mine).30 You can also use a command provided by the
heroku gem that automatically opens your browser with the right address:
$ heroku open
Once you've deployed successfully, Heroku provides a beautiful interface for administering and configuring your application (Figure 1.15).
1.4.4 Heroku commands
There are tons of Heroku commands, and we'll barely scratch the surface in this book. Let's take a minute to show just one of them by renaming the application as follows:
$ heroku rename railstutorial
Don't use this name yourself; it's already taken by me! In fact, you probably shouldn't bother with this step right now; using the default address supplied by Heroku is fine. But if you do want to rename your application, you can implement the application security mentioned at the start of this section by using a random or obscure subdomain, such as the following:
hwpcbmze.heroku.com seyjhflo.heroku.com jhyicevg.heroku.com
With a random subdomain like this, someone could visit your site only if you gave them the address. (By the way, as a preview of Ruby's compact awesomeness, here's the code I used to generate the random subdomains:
Pretty sweet.)
In addition to supporting subdomains, Heroku also supports custom domains. (In fact, the Ruby on Rails Tutorial site lives at Heroku; if you're reading this book online, you're looking at a Heroku-hosted site right now!) See the Heroku documentation for more information about custom domains and other Heroku topics.
1.5 Conclusion
We've come a long way in this chapter: installation, development environment setup, version control, and deployment. If you want to share your progress at this point, feel free to send a tweet or Facebook status update with something like this:
All that's left is to, you know, actually start learning Rails. Let's get to it!
- The most up-to-date version of Ruby on Rails Tutorial can be found on the book's website at http://www.railstutorial.org/. If you are reading this book offline, be sure to check the Rails Tutorial website for the latest updates. ↑
- RailsSpace, by Michael Hartl and Aurelius Prochazka (Addison-Wesley, 2007). ↑
- URL stands for Uniform Resource Locator. In practice, it is usually equivalent to "the thing you see in the address bar of your browser". By the way, the current preferred term is URI, for Uniform Resource Identifier, but popular usage still tilts toward URL. ↑
- These changes are slated for release as part of Rails 3, which is currently in beta. ↑
- In practice, this will involve omitting all files with
specin their name, as we will start to see in Section 3.2.2. ↑
- A new version of The Rails Way, covering Rails 3, is due out soon. You might want to wait for that to come out before buying it. ↑
- When reading Rails Tutorial, you may find it convenient to follow an internal section link to look at the reference and then immediately go back to where you were before. This is easy when reading the book as a web page, since you can just use the Back button of your browser, but both Adobe Reader and OS X's Preview allow you to do this with the PDF as well. In Reader, you can right-click on the document and select "Previous View" to go back. In Preview, use the Go menu:
Go > Back. ↑
- Indeed, the entire Rails community has this flavor. In a full room at RailsConf you'll see a handful of PCs in a sea of MacBooks—with probably half the PCs running Linux. You can certainly develop Rails apps on Microsoft Windows, but you'll definitely be in the minority. Since I have limited Windows Rails dev experience myself, I'd especially appreciate it if Windows readers could give me feedback about what works and what doesn't, so that we can get this tutorial to work on all common platforms. ↑
- The Ruby interpreter, called
ruby, parses and executes Ruby source code files. ↑
- The vi editor is one of the most ancient yet powerful weapons in the Unix arsenal, and Vim is "vi improved". ↑
- As of this writing, HTML Validator doesn't support the new HTML5 standard. If you need to validate HTML5 markup, I suggest using Total Validator. ↑
- Because gem updates often cause minor but potentially confusing breakage, in this tutorial I'll usually include an explicit version number known to work. Feel free to experiment, though; if you want to live on the edge, omit
-vand everything after it—just promise not to come crying to me if it breaks. ↑
- If you're running Linux and get an
unrecognized option '-v'error, this is a known issue running Rails on some versions of Debian. ↑
- The default Rails web server is WEBrick, a pure-Ruby server that isn't suitable for production use but is fine in development. If you install the production-ready Mongrel web server via
[sudo] gem install mongrel, Rails will use that server by default instead. Either way works. ↑
- Recall from Section 1.1.3 that Windows users might have to type
ruby script/serverinstead. ↑
- Normally, web sites run on port 80, but this usually requires special privileges, so Rails picks a less restricted higher-numbered port for the development server. ↑
- You can also access the application by visiting
0.0.0.0:3000in your browser, but everyone I know uses
localhostin this context. ↑
- It won't be your last. ↑
- Technically, this first invocation of
rake db:migratedoes add one table,
schema_migrations, which Rails uses internally to track changes to the data model. But don't worry about that right now. ↑
- Normally this is a feature, since it lets you continue to use the command line after launching your editor, but Git interprets the detachment as closing the file with an empty commit message, which prevents the commit from going through. I only mention this point because it can be seriously confusing if you try to set your editor to
gvimwithout the flag. If you find this note confusing, feel free to ignore it. ↑
- Here I'm using
mateto launch TextMate; of course, if you're not using TextMate you should substitute the command for your editor (e.g.,
gvim, or
mvim). ↑
- Windows users may get the message
warning: CRLF will be replaced by LF in .gitignore. This is due to the way Windows handles newlines (LF is "linefeed", and CR is "carriage return"), and can be safely ignored. If the message bothers you, try running
git config core.autocrlf falseat the command line to turn it off. ↑
- If in the future any unwanted files start showing up when you type
git status, just add them to your
.gitignorefile from Listing 1.2. ↑
- See the chapter Git Branching in Pro Git for details. ↑
- Experienced Git users will recognize the wisdom of running
git rebase masterbefore switching to the master branch, but this step will not be necessary in this book. ↑
- When collaborating on a project with other developers, you should run
git pullbefore this step to pull in any remote changes. ↑
- Though it shouldn't matter for the example applications in Rails Tutorial, if you're worried about accidentally making your app public too soon there are several options; see Section 1.4.4 for one. ↑
- Pronounced "Engine X". ↑
- Heroku works with any Ruby web platform that uses Rack middleware, which provides a standard interface between web frameworks and web servers. Adoption of the Rack interface has been extraordinarily strong in the Ruby community, including frameworks as varied as Sinatra, Ramaze, Camping, and Rails, which means that Heroku basically supports any Ruby web app. ↑
- Because of the details of their setup, the "About your application's environment" link doesn't work on Heroku; instead, you get an error much like the one in Figure 1.6. Don't worry; this is normal. The error will go away when we remove the default Rails page in Section 5.2.2. ↑


text:
Many web applications have limitations that are not disclosed to users. If you happen to use an application too frequently or upload too much data, your access will be disabled. In most cases, you'll see a message that informs you about the penalty, but Google Notebook chose a different strategy: showing a 404 error message.
"Back on December 20, I wrote about my frustration with Google Notebook, which I use every day as a way to archive much of what I read online (...). For some off reason, it seemed like Google Notebook was down, and yet I could find no other description of the issue online, which made me think I must be mad," writes Ran Barton.
He received a message from Google that explained the problem. "Your account was accidentally blacklisted by a blacklisting heuristic that looked at total size of notebook information. We've revised the heuristic, so you shouldn't be accidentally blacklisted again in the future."
January 9, 2008
Blacklisted from Google Notebook
This blog is not affiliated with Google.


text:
"Easy to fit." (E30114)
"I ordered from Epic on the reccomendation of a co-worker and found my experience to be even better than expected! Our salesperson was extremely helpful, the uniforms arrived within three business days, everything was exactly as I ordered, and the uniform itself is very good quality. Thank you for an easy and pleasureable buying experience for this first-time coach! We'll be back!" (E23111)
"Looks awesome. The embroidery is great. Very happy" (E833)
Epic Sports
Holloway Ladies' Dedication Flex-Sof Jackets [E48788]


text:
Summer Conference Services at Western Oregon UniversityConference/ Amenities
Are you planning a conference for your organization or seeking a venue for a camp for your group? No matter the size or scope of your event, the beautiful campus and professional staff at Western Oregon University would like to welcome you to come see what we have to offer you. From housing to dining to conference and classroom space to state of the art athletic facilities, we have what you need to make your event a success.
Our professional staff are well-trained, detail oriented and poised to see to your specific needs. Let us take on the details of providing comfortable housing and food as needed for your participants. Let us set up the smart class rooms and provide the conference meeting space that you will need for your event, while you focus your energies on the developement of your actual event. If your expectations are a beautiful, well appointed, centrally located venue with friendly, customer service oriented staff to provide seamless service, then Western Oregon University should host of your next event.
Please use the links above to being the planning process for your event and contact our Conference Services Coordinator if you have any specific questions regarding your event.
University Housing 503-838-8311 | or e-mail: firstname.lastname@example.com
Open the original version of this page.
Usablenet Assistive is a UsableNet product. Usablenet Assistive Main Page.


text:
Justice Roger Vinson of the U.S. District Court in Pensacola ruled today that the primary mechanism used by the health reform legislation to achieve universal insurance coverage–the individual mandate–is illegal. If his ruling stands it would void the 2,700 page, $938 billion health reform bill passed last year.
"Because the individual mandate is unconstitutional and not severable, the entire Act must be declared void. This has been a difficult decision to reach, and I am aware that it will have indeterminable implications," Vinson writes.
With this ruling, and a similar one in December by Judge Henry Hudson in Virginia, it's likely that the U.S. Supreme Court will be the final arbiter of whether ObamaCare stands. Two other lawsuits–one in Michigan and one in Virginia–were thrown out by other federal district judges last year who ruled the constitutional challenge lacked merit.
Most analysts were expecting a ruling in favor of the 26 states hoping to overturn the bill. Vinson, in an earlier ruling, suggested that the federal fine for not buying insurance is more of a penalty than a tax. If it's a penalty, the legislation relies on a broad interpretation of federal regulatory powers. If it's a tax, as the Department of Justice's lawyers argued, it's much more difficult to make a constitutional objection.
In today's ruling Vinson considered two arguments made by Florida Attorney General Bill McCollum, the lead plaintiff on the lawsuit. The first was the legislation forces states to expand Medicaid in a way that's unaffordable. Vinson quickly dispatches that legal theory, pointing out that Medicaid is and always has been a voluntary program.
The second argument revolves around the individual mandate. The health reform legislation makes it illegal for insurers to discriminate against patients regardless of their health. With that change there's a risk that only sick people would buy insurance and healthy people would wait or be priced out of the market. To address that problem, the bill forces everyone who does not have insurance to buy it. The combination of "guaranteed issue" and the "individual mandate" is the beating heart of the health bill.
While the new rules banning medical underwriting are popular, the individual mandate has bred resentment. The bill's authors never anticipated the mandate would become a ripe target for legal challenges.
The argument that's had the most traction is based on the limitations of the Commerce Clause of the Constitution. The Commerce Clause explicitly allows the federal government regulate interstate commerce. But it also has been used to justify federal laws that affect other kinds of economic activity. The question raised by the lawsuit against the health reform bill is whether refusing to buy insurance constitutes interstate commerce. In his ruling Vinson says that in the past the Commerce Clause has been used to regulate activities like growing marijuana or navigating a waterway, but not used to force someone to do something they weren't already doing. "It would be a radical departure from existing case law to hold that Congress can regulate inactivity under the Commerce Clause," he writes.
Vinson rejects the administration's argument that the health care market is unique since nobody can truly opt out–and that not buying insurance is in itself an economic activity since the cost of care then falls on others. Vinson mocks this argument, writing: "Everyone must participate in the food market… under this logic, Congress could [mandate] that every adult purchase and consume wheat bread daily." If they didn't buy wheat bread they might have a bad diet which would put a strain on the health care system, he writes.
Later he offers another analogy: "Congress could require that everyone above a certain income threshold buy a General Motors automobile — now partially government-owned — because those who do not buy GM cars (or those who buy foreign cars) are adversely impacting commerce and a taxpayer-subsidized business." Vinson concludes: "The individual mandate exceeds Congress' commerce power, as it is understood, defined, and applied in the existing Supreme Court case law."
- Page 1 / 2
- Continue


text:
Fabric & Patterns
Paper Goods
What's New
About Us
Receive our enews
© 2015 DS Designs, LLC
News Items
Creativebug Fabric Design Series!
2015 Workshops – register now!
Exhibitions & Events
Denyse's Modern Solids – new pre-cuts!
Modern Solids Challenge & Trunk Show
NEW quilt patterns!
Franklin fabrics – now in-store!
Hadley Challenge – SCT MQG
Denyse and Josef Albers
Modern Quilts, Traditional Inspiration
Pottery Barn Video
DSQ Quilt Donation Project!
Open Studio & Sale 2015
Quilt Alliance Interview
Thread Cult Podcast


text:
added to your cart.
added to wishlist.
added to compare products.
You have no items in your shopping cart.
Ice machine water filters are a necessity for the purest, cleanest ice from your ice machine. These filters help to remove contaminants that may also affect the way your ice tastes and smells. Ice machine filters provide other benefits as well, filtering out minerals and debris that may damage ice machines or reduce its production. Some companies will extend the warranty of their ice machines with the use of a water filter, while other warranties may be voided or limited if your water quality is poor. If your ice machine consistently makes use of lower quality water, it may require repairs and maintenance more often..
Our Articles and Other Information
Our Blog, Tips & Recommendations