• Complain

Wintermeyer - Learn Rails 5.2: Accelerated Web Development with Ruby on Rails

Here you can read online Wintermeyer - Learn Rails 5.2: Accelerated Web Development with Ruby on Rails full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2018, publisher: Apress, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Wintermeyer Learn Rails 5.2: Accelerated Web Development with Ruby on Rails
  • Book:
    Learn Rails 5.2: Accelerated Web Development with Ruby on Rails
  • Author:
  • Publisher:
    Apress
  • Genre:
  • Year:
    2018
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Learn Rails 5.2: Accelerated Web Development with Ruby on Rails: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Learn Rails 5.2: Accelerated Web Development with Ruby on Rails" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Learn to build Rails-based web applications using all the latest features offered in Rails 5.2. Author Stefan Wintermeyer begins by teaching the basics of Ruby 2.5 before proceeding through all aspects of Rails, utilizing clean, succinct examples rather than a single large application.
This book covers topics including Active Storage, Credentials, Active Record, Scaffolding, REST, Routing, Bundler, Forms, Cookies, and Sessions, all of which are vital for modern Rails web applications. To complement these topics youll also learn about test-driven development, Action Cable, Active Job, Action Mailer, I18n, Asset Pipeline, and caching. Finally, youll see a how-to for a production web server with nginx. This complete set of skills will set you up for a future of efficient and elegant Rails coding.
What You Will Learn
  • Use the Ruby on Rails web development framework
  • Install and manage the Rails framework
  • Persist data for your web application with Active Record
  • Work with forms
  • Apply a test-driven development approach to your Rails-based web applications
  • Discover many Rails secrets and tips
Who This Book Is For
Those with at least some prior programming experience. Ruby experience is helpful, but not required.

Wintermeyer: author's other books


Who wrote Learn Rails 5.2: Accelerated Web Development with Ruby on Rails? Find out the surname, the name of the author of the book and a list of all author's works by series.

Learn Rails 5.2: Accelerated Web Development with Ruby on Rails — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Learn Rails 5.2: Accelerated Web Development with Ruby on Rails" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Stefan Wintermeyer 2018
Stefan Wintermeyer Learn Rails 5.2
1. Ruby Introduction
Stefan Wintermeyer 1
(1)
Bochum, Germany
This chapter is a tightrope walk between oversimplification and a degree of detail that is unnecessary for a Rails newbie. After all, the objective is not to become a Ruby guru but to understand Ruby on Rails. I will elaborate on the most important points, and the rest is then up to you. If you would like to know more about Ruby, I recommend the book The Ruby Programming Language by David Flanagan and Yukihiro Matsumoto.
It is easy to program in Ruby, but Ruby is not a simple language.
Yukihiro Matsumoto
Ruby 2.5
Im going to use Ruby 2.5, but for most part of this book you can use older versions too. Ruby 2.5 is just a bit faster. You can check the installed Ruby version by running the command ruby -v , as shown here:
$ ruby -v
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]
$
Picture 1If your system is running an older version and you want to upgrade it, take a look at https://rvm.io , which is my preferred way of installing and using different Ruby versions.
Basics
Ruby is a scripting language. So, it is not compiled and then executed; instead, it is read by an interpreter and then processed line by line.
Hello World
A simple hello-world.rb program consists of one line of code, as shown in Listing .
puts 'Hello World!'
Listing 1-1
hello-world.rb
Use your favorite editor to open a new file with the filename hello-world.rb and insert the previous line into it. You can then execute this Ruby program at the command line as follows:
$ ruby hello-world.rb
Hello World!
$
Picture 2A program line in a Ruby program does not have to end with a semicolon. The Ruby interpreter is even so intelligent that it recognizes if a program line was split over two or more lines for the sake of readability. Indenting code is also not necessary. But it does make it much easier to read for human beings!
puts and print
If you look for examples on Ruby on the Internet, you will find two typical ways of printing text on the screen.
  • puts prints a string, followed by a newline.
  • print prints a string (without a newline).
Listing shows an example program (an extension of the program hello-world.rb ).
puts 'Hello World!'
puts
puts 'zzz'
print 'Hello World!'
print
puts 'zzz'
Listing 1-2
hello-world.rb
On the screen, you will see this:
$ ruby hello-world. rb
Hello World!
zzz
Hello World!zzz
Comments
A comment in a Ruby program starts with a # sign and ends with a newline. As an example, I added a comment to the earlier hello-world.rb program; see Listing .
# Program for displaying "Hello World!"
# by Stefan Wintermeyer
puts 'Hello World!'
Listing 1-3
hello-world.rb
A comment can also follow a program line, as shown in Listing .
puts 'Hello World!' # Example comment
Listing 1-4
hello-world.rb
A # sign within strings in a single quote mark is not treated as the start of a comment, as shown in Listing .
# Example program
# by Stefan Wintermeyer
puts 'Hello World!'
puts '############'
puts
puts '1#2#3#4#5#6#' # Comment on this
Listing 1-5
hello-world.rb
Help via ri
When programming , you do not always have a Ruby handbook available. Fortunately, the Ruby developers thought of this and provided a built-in help feature in form of the program ri .
Picture 3Of course, you must have installed the documentation, which is the default. If you used rvm to install Ruby, you can run rvm docs generate to generate the documentation.
This is a typical chicken-and-egg situation. How can I explain the Ruby help feature if you are only just getting started with Ruby? So, I am going to jump ahead a little and show you how you can search for information on the class String .
$ ri String
[...]
$
Picture 4Many times it is easier and more informative to use Google instead of ri .
irb
irb stands for I nteractive R u b y and is a kind of sandbox where you can play around with Ruby at your leisure. You can launch irb by entering irb on the shell and end it by entering exit .
An example is worth a thousand words.
$ irb
irb(main):001:0> puts 'Hello World!'
Hello World!
=> nil
irb(main):002:0> exit
$
Picture 5In future examples, I use IRB.conf[:PROMPT_MODE] = :SIMPLE in my .irbrc config file to generate shorter irb output (without the irb(main):001:0> part). You can do the same by using irb --simple-prompt .
Ruby Is Object-Oriented
Ruby only knows objects. Everything is an object (sounds almost like Zen). Every object is an instance of a class. You can find out the class of an object via the method .class .
An object in Ruby is encapsulated and can be reached from the outside only via the methods of the corresponding object. What does this mean? You cannot change any property of an object directly from the outside. The corresponding object has to offer a method with which you can do so.
Picture 6Please do not panic if you have no idea what a class or an object is. I wont tell anyone, and you can still work with them just fine without worrying too much. This topic alone could fill whole volumes. Roughly speaking, an object is a container for something, and a method changes something in that container.
Please go on reading and take a look at the examples. The puzzle will gradually get clearer.
Methods
In other programming languages , the terms you would use for Ruby methods would be functions , procedures , subroutines , and of course methods .
Picture 7Here I go with the oversimplification. You cannot compare non-object-oriented programming languages with object-oriented ones. Plus, there are two kinds of methods (class methods and instance methods). I do not want to make it too complicated. So, I simply ignore those fine distinctions.
At this point, you probably want to look at a good example, but all I can think of are silly ones. The problem is the assumption that you are only allowed to use knowledge that has already been described in this book .
So, lets assume that you use the code sequence in Listing repeatedly (for whatever reason).
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Learn Rails 5.2: Accelerated Web Development with Ruby on Rails»

Look at similar books to Learn Rails 5.2: Accelerated Web Development with Ruby on Rails. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Learn Rails 5.2: Accelerated Web Development with Ruby on Rails»

Discussion, reviews of the book Learn Rails 5.2: Accelerated Web Development with Ruby on Rails and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.