Leanpub Header

Skip to main content

เกิดอยากจะเขียน API ง่ายๆ ด้วย Ruby on Rails

เขียนง่าย เขียนสนุก เขียนโปรแกรมไม่ควรจะยากตั้งแต่เริ่มต้น หากเริ่มแล้วยาก ใครจะอยากทำต่อ มาเขียน Ruby on Rails กันเถอะ

เขียนง่าย เขียนสนุก เขียนโปรแกรมไม่ควรจะยากตั้งแต่เริ่มต้น หากเริ่มแล้วยาก ใครจะอยากทำต่อ มาเขียน Ruby on Rails กันเถอะ

ซื้อหนังสือผ่านการโอนเงินง่ายๆ แอดไลน์ @geekstart ได้เลยครับ

The author is letting you choose the price you pay for this book!

Pick Your Price...
PDF
166
Readers
About

About

About the Book

ซื้อหนังสือฉบับสั่งพิมพ์ผ่าน shopee ง่ายๆได้เลยคับ
https://links.geekstart.io/l/ror-book

ซื้อ ebook ผ่านการโอนเงินง่ายๆ แอดไลน์ @geekstart ได้เลยครับ

Ruby on Rails

Web framework ที่สร้าง successful startup มามากมาย และ ถูกใช้งานบน Platform ใหญ่ๆเช่น

GitHub, dev.to, Basecamp, HEY, Shopify, Airbnb, Twitch, SoundCloud, Hulu, Zendesk, Square, Cookpad

Web framework ที่ใช้งานง่ายมาก เขียนง่าย เข้าใจง่าย

เหมาะสำหรับทำ API สำหรับ Web Application หลากหลายรูปแบบ เหมาะกับ ธุรกิจเกือบทุกชนิด

Technical Debt น้อย อัพเกรดง่าย Convention / Standard ชัดเจน

ทำให้การเขียนโปรแกรมเป็นเรื่องสนุก มากกว่าการแก้ปัญหา

หนังสือเล่มนี้ จะทำให้คุณสร้าง API ได้ยันคุณทำ Project ของคุณเสร็จได้เลย

รวบรวมจากประสบการณ์ใช้ Ruby on Rails มามากกว่า 9 ปี ไม่ว่าจะเป็นงานใหญ่ งานเล็ก รับได้หมด

Price

Pick Your Price...

Minimum price

$11.99

$11.99

You pay

$11.99

Author earns

$9.59
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 1)

1
The author will earn $12.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Author

Tanasak Tantitarntong

I'm a self taught programmer with over 10 years experience.

I joined Leanpub to share my knowledge and experience.

I started my own company, a software house, in the year 2010.

I coded lots of projects throughout those years trying out lots of stuffs like

ObjectiveC, Ruby on Rails, Nodejs, Swift, Java, Kotlin, Dart, Golang, ionic, react-native, Vue, React, ....

Deployed them on a bunch for infrastructures

Bare Metal, Government Cloud, VPS, Digital Ocean, AWS, Google Cloud Platform, and on some Serverless arch

Taught Internet Programming to 70+ students in University as part-time lecturer in Thailand.

Trained over 100+ people in iOS Basic and Advance courses ages ago when there were no Swift.

Taught high school math for a year, 36 hours a week.

My dream is to start a school where all students can do what the love. (and not hate Math)

Obviously, it takes a lot of money to start a school. If you can fund me a few million $ to start a school in Thailand, Please contact me.

I hope you enjoy my books.

Visit my youtube channel at https://youtube.com/sakkosama

Translations

Translations

Languages

Contents

Table of Contents

1Introduction

2เตรียมเครื่อง

  1. 2.1RVM
  2. 2.2Ruby
  3. 2.3NVM (optional)
  4. 2.4NodeJS (optional)
  5. 2.5Text Editor
  6. Atom
  7. Sublime
  8. VSCode
  9. 2.6Postman / Hoppscotch

3Creating Ruby on Rails Project

4Folder structure

  1. 4.1.ruby-version
  2. 4.2.ruby-gemset (new)
  3. 4.3Gemfile & Gemfile.lock
  4. 4.4config folder
  5. config/database.yml
  6. config/Environments files
  7. 4.5app folder
  8. app/controllers/application_controller.rb
  9. app/models/application_record.rb
  10. 4.6อื่นๆ

5Ruby

  1. 5.1Numbers
  2. 5.2BigDecimal (Rails only)
  3. 5.3Strings
  4. 5.4Comment
  5. 5.5Print
  6. 5.6Object Methods
  7. 5.7Array
  8. 5.8Hash
  9. 5.9Blocks
  10. 5.10Modify Built-in Class

6Controllers for Beginner

  1. 6.1HTTP Request / Actions
  2. 6.2Static GET API
  3. Cross origin request (rack-cors)
  4. 6.3POST PUT DELETE for Static

7Models and Migration

  1. 7.1Creating Model
  2. 7.2Migrating Database

8Rails Console

  1. 8.1The power of Rails console
  2. 8.2Rails powered by Ruby is fun

9CRUD ​API ใช้งานได้จริง

  1. 9.1Review บทก่อนหน้า
  2. 9.2RESTful APIs
  3. 9.3API GET users
  4. 9.4API GET users/:id
  5. 9.5API POST /users create
  6. 9.6API PATCH /users/:id update
  7. 9.7API DELETE /users/:id destroy
  8. 9.8Resourceful routes
  9. 9.9สรุปบท CRUD API

10The Power of Scaffolding

  1. 10.1rails g scaffold
  2. 10.2Controller from scaffold

11Model Relationship

  1. 11.1ER Diagram
  2. 11.2Starting small project
  3. 11.3Scaffold APIs
  4. 11.4The Missing APIs
  5. 11.5Model’s Relationship
  6. 11.6Testing Model’s Relationship
  7. 11.7Add missing API
  8. 11.8อื่นๆเกี่ยวกับ API

12Sending Emails

  1. 12.1Action Mailer Basic
  2. 12.2Email Template Layouts
  3. 12.3Test sending email

13Errors Rescue

  1. 13.1Ruby Rescue
  2. 13.2(API) ApplicationController Rescue
  3. Error Class (StandardError)
  4. rescue_from
  5. 13.3Example Classes to rescue

14Authenticating API with JWT

  1. 14.1Devise Gem
  2. 14.2JWT for User model
  3. 14.3Session Controller
  4. 14.4Sign up API
  5. 14.5Sign in API
  6. 14.6User profile API (from JWT)
  7. 14.7Sign out API

15Model Validation

  1. 15.1Simple Presence Validation
  2. 15.2Validating Inclusion
  3. 15.3Validating Length
  4. 15.4Validate Numbers
  5. 15.5Custom Validation

16Active Record Query Interfaces

  1. 16.1Date query
  2. 16.2Where NOT
  3. 16.3Scope
  4. 16.4Scope with function
  5. 16.5Ordering
  6. 16.6Relationship Ordering
  7. 16.7Readonly Objects
  8. 16.8Querying Relationship
  9. 16.9Eager Loading
  10. n+1 query
  11. 16.10Selecting Fields to Query
  12. 16.11Calculations
  13. .count
  14. .sum
  15. .average
  16. .minimum
  17. .maximum
  18. Others

17Caching with Rails

  1. 17.1Installing Redis
  2. 17.2การ Config Cache Store on Rails
  3. 17.3Simple Key Caching
  4. 17.4Model Caching

18Upload File / Image

  1. 18.1Setup ActiveStorage
  2. 18.2Adding ActiveStorage to Model
  3. 18.3Adding Upload Image API
  4. 18.4Storage Location Config
  5. Disk Storage
  6. Amazon S3 Storage
  7. Google Cloud Storage
  8. AzureStorage
  9. ข้อควรระวัง

19Managing Status with State Machine

  1. 19.1Act as state machine (aasm)
  2. 19.2AASM Events
  3. 19.3AASM Callbacks

20Unit tests

  1. 20.1Using rails test
  2. 20.2Test Driven Development (TDD)
  3. 20.3Unit test with fixtures and setup feature

21Deploying Rails

  1. 21.1Requirements
  2. 21.2Setting New User in ubuntu
  3. 21.3Setting ubuntu for rails
  4. 21.4nginx passenger
  5. 21.5Cloning Project
  6. 21.6Config Nginx Passenger

22สรุป

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub