background preloader

Ruby

Facebook Twitter

Install Ruby on Rails 4.2 · Ubuntu. By Daniel Kehoe Last updated 6 December 2016 Install Ruby on Rails 5.2 on Ubuntu Linux.

Install Ruby on Rails 4.2 · Ubuntu

Up-to-date, detailed instructions for the Rails newest release. How to install Rails 5.2, the newest version of Rails, on Ubuntu. This in-depth installation guide is used by developers to configure their working environment for real-world Rails development. To develop with Rails on Ubuntu, you’ll need Ruby (an interpreter for the Ruby programming language) plus gems (software libraries) containing the Rails web application development framework. For an overview of what’s changed in each Rails release, see a Ruby on Rails Release History.

Ruby on Rails Tutorial (3rd Ed.) 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).

Ruby on Rails Tutorial (3rd Ed.)

This book by Michael Hartl came so highly recommended that I had to try it, and the 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 linear narrative is such a great format. Enjoy! Derek Sivers (sivers.org) Founder, CD Baby. Gonzalo-bulnes/simple_token_authentication · GitHub. Adding Custom Fields to Your Devise User Model in Rails 4 - Jaco Pretorius.

I am currently working with Rails 4 and Devise 3.2.2.

Adding Custom Fields to Your Devise User Model in Rails 4 - Jaco Pretorius

Devise already creates all the routes and controllers for allowing users to sign up, but as with most applications I want to customize the user model and add additional fields. Let’s take a look at how we would go about making these changes by adding a first and last name to the user. First off, we create the migration – nothing special here. Now we actually need to show these fields on the edit form - we can do this by adding a view to app/views/devise/registrations/new.html.slim (I'm using slim as my templating engine, you can use haml or erb or whatever you choose).

I usually open the devise gem (bundle open devise) and then copy the devise view into my application and modify it. When you now try and sign up you should see the new custom form, but your custom fields will not be persisted. Customizing the RegistrationsController Similarly, when we update a user's account this method is used to sanitize the parameters: Rails Beginner Cheat Sheet.

Bold words are what is really important e.g. the command and concept shown in the usage category.

Rails Beginner Cheat Sheet

In the code usage and example columns these highlight the main part of the concept, like this: general_stuff.concept. In the same columns italic_words mark the arguments/parameters of a command/method. However italic words in the descriptions or general text denote more general concepts or concepts explained elsewhere in this cheat sheet or in general. The console (also called command line, command prompt or terminal) is just another way of interacting with your computer. So you can basically do anything with it that you could also do with your graphical desktop user interface.

For the different operating systems starting the console differs. Windows: Open the start menu and search for command prompt. Writing a web application with Ruby on Rails. Unless you have lived under a rock for the past 5 years or so, you should have already heard of Ruby on Rails.

Writing a web application with Ruby on Rails

In this article, we’ll write a very simple web application to show its power and speed of development. We’ll cover the following topics: install Rubyinstall the rails gemhow to start a new rails projectdirectory structure of a rails projecthow to manage data with a databaseuse already available components to handle common tasksadd CRUD resourcesimprove the app flawlessy Quick setup The following section offers a very quick overview of the tools you need to get started with Ruby on Rails development. Install Ruby If you run Linux or MacOSX on your computer, you may already have Ruby installed by default, however these kind of installations are out of date (eg: ruby 1.8.x) and gems are difficult to manage.

Code School - Rails for Zombies. Try Ruby: learn the basics of the Ruby language in your browser. Learn Ruby.