ORPP logo

Rails : Build Your Own Ruby on Rails Website.

Goodrich, Glenn.

Rails : Build Your Own Ruby on Rails Website. - 3rd ed. - 1 online resource (538 pages)

Intro -- Rails: Novice to Ninja -- Notice of Rights -- Notice of Liability -- Trademark Notice -- About Glenn Goodrich -- About SitePoint -- Table of Contents -- Preface -- Who Should Read This Book -- Conventions Used -- Code Samples -- Tips, Notes, and Warnings -- Hey, You! -- Ahem, Excuse Me ... -- EXTRA CREDIT -- Make Sure You Always ... -- Watch Out! -- Supplementary Materials -- Introducing Ruby on Rails -- Classes? -- What does Ruby syntax look like? -- History -- Development Principles -- Optimize for Programmer Happiness -- Convention Over Configuration -- MVC -- The Menu is Omakase -- No One Paradigm -- Exalt Beautiful Code -- Value-integrated Systems -- Progress Over Stability -- Push Up a Big Tent -- Building the Example Web Application -- Features of the Example Application -- Summary -- Getting Started -- Found in Translation -- New ≠ Tried + Tested -- What does all this cost? -- Installing on Windows -- Install Ruby -- Installing on Mac OS X -- Taking Command -- Installing Homebrew -- Version Managers: Good for Developing Developers! -- Why default? -- Help on Hand -- Installing on Linux (Ubuntu) -- About Rais Girls -- Additional Installation Options -- And Now the Fun Begins -- One Directory Structure to Rule Them All -- Creating the Standard Directory Structure -- Starting Our Application -- Choice Gems: A Plethora of Web Servers -- Version Control and Git -- EXTRA CREDIT: Get Learning Git -- Git Basics -- Which Text Editor? -- Windows and Cross-platform Text Editors -- Sublime Text -- Atom -- Visual Studio Code -- Linux and Mac OS X Editors -- Emacs -- Vim -- IDEs -- Summary -- Introducing Ruby -- Ruby is a Scripting Language -- Compiled Languages -- Scripting Languages -- The Great Performance Debate -- Choose What Works -- Ruby is an Object Oriented Language -- Reading and Writing Ruby Code -- The Interactive Ruby Shell (irb). Windows Users -- Constants, Classes, and Capitals -- Interacting with Ruby Objects -- Literal Objects -- Variables and Constants -- Scoping Scope -- Watching Your G's and Q's -- Basic Punctuation in Ruby -- Dot Notation -- EXTRA CREDIT: Dot Notation -- Chaining Statements Together -- Use of Parentheses -- Method Notation -- Predicate Method -- Object-oriented Programming in Ruby -- Classes and Objects -- EXTRA CREDIT: Access Levels for Object Methods -- Object-level Functionality -- Instance Variables -- A Link to Social Media -- Instance Methods -- Indentation in Ruby -- Accessor Methods -- Class-level Functionality -- Avoid the CV Word -- Inheritance -- Modules and Composition -- Support for Methods -- Return Values -- Standard Output -- Put It There -- Ruby Core Classes -- Strings -- Ruby Interactive Documentation -- Numerics -- Symbols -- Arrays -- Hashes -- nil Values -- Running Ruby Files -- Control Structures -- Conditionals -- The if Construct -- The unless Construct -- Loops -- while and until Loops -- Assignment and Equation Operators -- for Loops -- Blocks, Procs, and Lambdas. Oh my! -- EXTRA CREDIT: Ruby Rites -- Summary -- Rails Revealed -- Three Environments -- Application Dependencies -- Bundler -- EXTRA CREDIT: Bundler's Brass Tacks -- Database Configuration -- The Database Configuration File -- Yo YAML! -- EXTRA CREDIT: Database Engines -- The Model-View-Controller Architecture -- MVC in Theory -- MVC the Rails Way -- The ActiveRecord Module -- Database Abstraction -- The Jury's Out on ActiveRecord -- Database Tables -- Object Relational Mapper -- Seek some SQL Smarts -- Using the Rails Console -- Saving an Object -- Defining Relationships between Objects -- The ActionPack Library -- ActionController (the Controller) -- Naming Conventions for Classes and Files -- ActionView (the View) -- RESTful-style -- In Theory -- REST and the Web. EXTRA CREDIT: Verbalicious -- REST in Rails -- Code Generation -- The ActionMailer Component -- Testing and Debugging -- Testing -- Unit Testing -- EXTRA CREDIT: Test Driving TDD -- Integration Testing -- Debugging -- Summary -- Models, Views, and Controllers -- Generating a Model -- The Model Generator -- Running the generate Command -- Understanding the Output -- app/models/story.rb -- EXTRA CREDIT: The Attributes API -- test/models/story_test.rb -- test/fixtures/stories.yml -- db/migrate/xxxxx_create_stories.rb -- Understanding YAML -- Modifying the Schema Using Migrations -- Creating a Skeleton Migration File -- Migrations, Compatibility, and 5.0 -- Creating the stories Table -- Running the Migration -- Rollbacks up Close -- Managing Data Using the Rails Console -- Creating Records -- Retrieving Records -- Updating Records -- Deleting Records -- Generating a Controller -- Running the generate Command -- Understanding the Output -- app/controllers/stories_controller.rb -- route get 'stories/index' -- app/helpers/stories_helper.rb -- app/views/stories/index.html.erb -- test/controller/stories_controller_test.rb -- Take Care When It Comes to Naming Parameters -- Starting Our Application … Again -- Creating a View -- Generating Views with Scaffolding -- When You Go Off the Rails ... -- A Great Tool-but with Limitations -- Creating Static Pages -- Creating Dynamic Pages -- Passing Data Back and Forth -- Pulling in a Model -- Summary -- Helpers, Forms, and Layouts -- Calling upon Our Trusty Helpers -- Enabling Story Submission -- Creating a Form -- Introducing the form_for Helper -- Help on Helpers -- Creating the Template -- The Console Is Key -- Modifying the Controller -- RESTful Resources in Rails -- Mapping a New Resource -- Analyzing the HTML -- Saving Data to the Database -- Redirecting with URL helpers -- EXTRA CREDIT: Going Private. Creating a Layout -- Establishing Structure -- Built-in Abettors -- Adding Some Style -- CSS Mastery Not Required -- Enabling User Feedback with the Flash -- Adding to the Flash -- Flash Naming Conventions -- Retrieving Data from the Flash -- Applying Validations -- Tweaking the Redirection Logic -- Improving the User Experience -- Testing the Form -- EXTRA CREDIT: Minitest versus RSpec -- Testing the Model -- Analyzing the Skeleton File -- Using Assertions -- Writing a Unit Test -- A Choice of Syntaxes for Testing -- Errors and ActiveModel Errors -- Running Model Tests -- Ensure the Test Database is Set Up -- Testing the Controller -- Analyzing the Skeleton File -- Writing a Controller Test -- HTTP Code Aliases -- Running a Controller Test -- Writing More Controller Tests -- Running the Complete Test Suite -- Visiting the Logs -- Summary -- Ajax and Turbolinks -- Generating a Vote Model -- Creating the Model -- Examining the Vote Migration -- Applying the Migration -- Introducing Relationships -- Introducing the has_many Clause -- Collection Proxy Helps Efficiency -- Introducing the belongs_to Clause -- Revise, Reload, Revise, Reload -- How's our schema looking? -- Making a Home for Each Story -- Determining Where a Story Lives -- Displaying Our Stories -- Recap on Making Sure the Server Is Up -- Improving the Story Randomizer -- Implementing Clean URLs -- Converting from Strings -- Investigating Link Generation -- Ajax, Pjax, and Turbolinks -- Introducing Ajax -- Making Stories -- Controlling Where the Votes Go -- The Asset Pipeline -- Geek Etymology -- Why do we need an asset pipeline? -- Multiple Source Files -- Asset Preprocessors -- CoffeeScript -- CoffeeScript or JavaScript? -- Sass -- Syntactically Awesome, or Simply Cascading? -- Asset Compression and Minification -- Asset Digests -- Get Out the Vote -- Styling the Scoreboard. Response Formats -- Shorthand Awesomeness -- Introducing Partials -- Adding Voting History -- Creating the Partial -- Styling the Voting History -- Tweaking the Voting History -- A Methods of Sorts -- Testing the Voting Functionality -- Testing the Model -- Preparing the Fixtures -- Check One Two -- Testing a Story's Relationship to a Vote -- Testing the Voting History Order -- Running the Unit Tests -- Testing the Controller -- Testing Page Rendering -- Testing Vote Storage -- Testing Ajax Voting -- EXTRA CREDIT: Make a Difference -- Testing Regular HTTP Voting -- Running the Full Test Suite -- Summary -- Protective Measures -- Introducing Sessions and Cookies -- Identifying Individual Users -- What's a cookie? -- What's a session? -- Sessions in Rails -- Session Storage Solutions -- Modeling the User -- Generating a User Model -- Has Secure Password -- Server Reboot Required -- Adding Relationships for the User Class -- Creating a User -- Developing Login Functionality -- Creating the Controller -- Creating the View -- Start Your Engines... -- Adding Functionality to the Controller -- Be Careful When Storing ActiveRecord Objects in a Session -- Introducing Filters -- Before Filters -- After Filter -- Around Filters -- EXTRA CREDIT: A Filter Field Trip -- A Word on Filter Methods -- Managing User Logins -- Retrieving the Current User -- Session Security -- Displaying the Name of the Current User -- Allowing Users to Log Out -- Adding a Navigation Menu -- Restricting the Application -- Protecting the Form -- Abstracting Code Using helper_method -- Requiring Users to Log In -- Good Coding Grammar -- Restricting Access to Story Submission -- Introducing Filter Conditions -- Redirecting the User -- Associating Stories with Users -- Storing the Submitter -- Displaying the Submitter -- Complete Data -- One Last Thing: Associate Votes to Users. Testing User Authentication.

9781492018384


Object-oriented programming languages.


Electronic books.

TK5105.888.G663 2016

6.76

© 2024 Resource Centre. All rights reserved.