Rails Routing from the Outside In
1 The Purpose of the Rails Router The Rails router recognizes URLs and dispatches them to a controller's action. It can also generate paths and URLs, avoiding the need to hardcode strings in your views. 1.1 Connecting URLs to Code When your Rails application receives an incoming request for: it asks the router to match it to a controller action. 1.2 Generating Paths and URLs from Code You can also generate paths and URLs. and your application contains this code in the controller: and this in the corresponding view: then the router will generate the path /patients/17. 2 Resource Routing: the Rails Default Resource routing allows you to quickly declare all of the common routes for a given resourceful controller. 2.1 Resources on the Web Browsers request pages from Rails by making a request for a URL using a specific HTTP method, such as GET, POST, PATCH, PUT and DELETE. it asks the router to map it to a controller action. 2.2 CRUD, Verbs, and Actions 2.3 Path and URL Helpers 2.5 Singular Resources
The Asset Pipeline
1 What is the Asset Pipeline? The asset pipeline provides a framework to concatenate and minify or compress JavaScript and CSS assets. It also adds the ability to write these assets in other languages and pre-processors such as CoffeeScript, Sass and ERB. The asset pipeline is technically no longer a core feature of Rails 4, it has been extracted out of the framework into the sprockets-rails gem. The asset pipeline is enabled by default. You can disable the asset pipeline while creating a new application by passing the --skip-sprockets option. Rails 4 automatically adds the sass-rails, coffee-rails and uglifier gems to your Gemfile, which are used by Sprockets for asset compression: Using the --skip-sprockets option will prevent Rails 4 from adding sass-rails and uglifier to Gemfile, so if you later want to enable the asset pipeline you will have to add those gems to your Gemfile. 1.1 Main Features The second feature of the asset pipeline is asset minification or compression. More reading:
Michael Hartl’s 15 Hours of Rails 3 Screencasts
By Peter Cooper / October 13, 2010 Have you seen Michael Hartl's RailsTutorial.org? It's a free online "book" that walks you through from start to finish with building either a Rails 2.3 or Rails 3.0 app (though a $39 PDF rendering is also available). Michael's project is the latest in a line of self publishing efforts in the Ruby and Rails communities and it's gone down a storm on Hacker News. At $85, they might seem steep to some readers, but if you basically want to be able to look "over the shoulder" of an experienced Rails developer and see how a Rails development environment is set up and how multiple apps are built, there's nothing that can beat this. So if you want to learn Rails 3.0 in a practical manner from the ground up, check out Michael's screencasts.
Ruby on Rails Tutorial | Softcover.io
Welcome to the Ruby on Rails Tutorial. The goal of this book is to be the best answer to the question, “If I want to learn web development with Ruby on Rails, where should I start?” By the time you finish the Ruby on Rails Tutorial, you will have all the skills you need to develop and deploy your own custom web applications with Rails. You will also be ready to benefit from the many more advanced books, blogs, and screencasts that are part of the thriving Rails educational ecosystem. Finally, since the Ruby on Rails Tutorial uses Rails 4, the knowledge you gain here represents the state of the art in web development. (The most up-to-date version of the Ruby on Rails Tutorial can be found on the book’s website at if you are reading this book offline, be sure to check the online version of the Rails Tutorial book at for the latest updates.) Box 1.1. Box 1.2. 1.1 Introduction What makes Rails so great? 1.1.2 “Scaling” Rails Browsers
Ruby on Rails guides
Getting Started with Rails
1 Guide Assumptions This guide is designed for beginners who want to get started with a Rails application from scratch. It does not assume that you have any prior experience with Rails. Rails is a web application framework running on the Ruby programming language. Be aware that some resources, while still excellent, cover versions of Ruby as old as 1.6, and commonly 1.8, and will not include some syntax that you will see in day-to-day development with Rails. 2 What is Rails? Rails is a web application development framework written in the Ruby programming language. Rails is opinionated software. The Rails philosophy includes two major guiding principles: Don't Repeat Yourself: DRY is a principle of software development which states that "Every piece of knowledge must have a single, unambiguous, authoritative representation within a system." 3 Creating a New Rails Project The best way to read this guide is to follow it step by step. 3.1 Installing Rails Open up a command line prompt. 9 Security
Top 12 Ruby on Rails Tutorials
A former student asked me a few days ago how I learned Ruby on Rails. The answer was that I simply read alot of great tutorials. So in the spirit of sharing, here are the 12 tutorials that I found most useful: Rolling with Ruby on Rails – Curtis Hibbs of ONLamp.com offers his first excellent introduction to Ruby on Rails. This is the article that got me really excited about RoR.2. Hey, Ruby on Rails Fans! UPDATE, JUNE 2009: Want more up-to-date tutorials on Ruby programming? Happy Rails developing and if you have any other tutorials that you’d like to share, please leave them in the comments! Tagged as: ruby on rails, tutorial
Related:
Related: