Ryan Bigg - Exploding Rails
Here you can read online Ryan Bigg - Exploding 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-2019, publisher: Leanpub, 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.
Exploding Rails: summary, description and annotation
We offer to read an annotation, description, summary or preface (depends on what the author of the book "Exploding Rails" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.
Exploding 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 "Exploding 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.
Font size:
Interval:
Bookmark:
This book is for sale at http://leanpub.com/explodingrails
This version was published on 2019-03-29
* * * * *
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and many iterations to get reader feedback, pivot until you have the right book and build traction once you do.
* * * * *
Thank you for reading Exploding Rails.
If you find any misteaks while reading this book, please email them tome@ryanbigg.com.
If you have a problem to do with your code, then please put the code on GitHub andlink me to it in the email so I can clone it and attempt to reproduce the problem myself. Ifyou dont understand something, then its more likely that Im the idiot andrushed it when I wrote it. Let me know!
This far into the book and theres already one error. You should expect that itis not alone. It has friends and their ways are devious. They are coming afteryour perception of reality. Beware.
In similar fashion to my Toy RobotWalkthrough, this book started out as a blogpost that I was going to put up at ryanbigg.com. I knewthat this post was going to be very long the very first day I started writingit, because it was 5,000 words by the end of the day and I still had a lot tosay on the topic of organising a Rails application in a better way. Its nowabout 15,000 words. So I think it deserves to be a little book on Leanpub,rather than just a blog on my website.
The idea for this blog-post-turned-book came out of the CultureAmp Junior Engineering Program that I am running. Oneof the junior developers that I mentor Seb Pearce came up with the ideaof building an expense tracker application. So I thought, OK, this is going tobe a run-of-the-mill Rails application with a Transaction
model and so on.Then he told me that he wanted to build the application in Ruby, withoutRails.
Well then.
So we went about doing that, sticking to plain Ruby code as much as possible.Eventually, we introduced some gems like rom-rb
, rom-sql
, dry-validation
and dry-transaction
. I had only really toyed around with these gemspreviously, and had never built anything serious with them, and so whenpairing with Seb it gave us both an opportunity to explore using these gems ina semi-serious application.
And it was bloody brilliant.
The code for validating a transactions attributes lived over here. The codefor talking with the database lived over here. The models of theapplication were slimmed right down to classes that knew only what attributesand business logic Transaction
objects should have.
It reminded me a lot of how I felt when I saw Rails for the first time:everything had a neat orderly place. There were clean lines ofresponsibility between each part of the application. The model was no longer aone-stop-shop for validation, persistence and business logic. The modelstopped feeling like that moving box labelled miscellaneous that you dumpall your trinkets into during a move. The model felt like it represented thestructure of data for a particular thing in the application, and that wasbeautiful. The model only had a single responsibility.
(I should also mention that Phoenixapplications are structured somewhat similarly, but since this is a Ruby bookthat is all I will be saying about Elixir, for now.)
Seb and I have just recently gotten to the point of integrating his plain Rubycode with a Ruby web framework, with the intention of providing an API that aReact frontend can read from. After a little bit ofdeliberation over what non-Rails framework he could use, Seb settled onSinatra. Its a fine choice that works well for Sebs application.
Meanwhile, I wanted to play around with rom-rb
and dry-rb
in a Railsapplication of my own making. My first goal was that I wanted to build a Railsapplication without Active Record. The second goal was that if the logic inthe controller got too messy, I would have to abstract that out to a serviceobject with dry-transaction
. Youll see how Ive accomplished both of thosegoals in this guide.
I found out that there was a gem called rom-rails
and I startedexperimenting. The notes that I took eventually coalesced into this guide.
This book is best suited for experienced Rails developers. Ill assume a lotof knowledge around things like the normal structure of Rails applications,feature testing, what at least the concept of a service object is, and so on.
If youre new to Ruby, you will probably understand some of the terms Imusing here, but to get the most out of this guide you should have some Railsexperience under your belt.
Ideally, you shouldve encountered places where using vanilla Rails has hurtyou, your friends and possibly even your family members. But thats notnecessary because theres a few examples peppered throughout this guide thatwill give you a good inkling. Rails is good, but it is not without its flaws.
This book is not supposed to be The Bible of How to Integrate ROM into yourRails application. Its merely a short guide covering how one eager developerbuilt the beginnings of a little Rails application using the rom-rb
anddry-rb
gems.
Id like to thank Tiya Belayneh, Andy Holland, Tim Riley, Chris Flipse, andPiotr Solnica for their feedback on early editions of this book. It has beeninvaluable to have such dedicated readers reviewing this book. I would alsolike to thank Rob Jacoby and Seb Pearce (again) for inspiring me to write thefirst chapter of the book.
Thank you to Francois Beausoleil, Bruno Bonamin, Brian Buchalter, AceDimasuhid, Rob Howard, and Michael Kohl, Rocio Diaz-Meco, Sean Liu and TristanPenman for reporting errata in this book.
Theres probably more errata to report, so if you find any, please emailme@ryanbigg.com with what you find and you too can go on this list ofoutstanding people.
When Rails came out, it was revolutionary. There was an order to everything.
Code for your business logic or code that talks to the database obviouslybelongs in the model.
Code that presents data in either HTML or JSON formats obviously belongs inthe view.
Any special (or complex) view logic goes into helpers.
The thing that ties all of this together is obviously the controller.
It was (and still is) neat and orderly. Getting started with a Railsapplication is incredibly easy thanks to everything having a pre-assigned home.
The Rails Way enforces these conventions and suggests that this is theOne True Way to organise a Rails application. This Rails Way suggests that,despite there being over a decade since Rails was crafted, that there still isno better way to organise an application than the MVC pattern that Railsoriginally came with.
While I agree that this way is still extremely simple and great for gettingstarted within a Rails application, I do not agree that this is the best way toorganise a Rails application in 2018 with long-term maintenance in mind.
Font size:
Interval:
Bookmark:
Similar books «Exploding Rails»
Look at similar books to Exploding 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.
Discussion, reviews of the book Exploding 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.