SlideShare a Scribd company logo
1 of 55
Download to read offline
Rails
  Ruby on Rails




         1
Who am I

• I’m
• Master: Ruby & Ruby on Rails
• Company: PIXNET
• Site: http://belovely.tw/
• Blog: http://wildjcrt.pixnet.net/
                       2
Agenda

• Introduction Ruby on Rails
• Rails basic training course
• Working experience
• Example
                   3
Introduction
Ruby on Rails


     4
Ruby
•                                     Matz
•      Perl 6             pearl
     Ruby 7              ruby
* http://www.ruby-lang.org/en/
* http://www.ruby-lang.org/zh_TW/ (   )
* http://ruby.tw/ ( )
                    5
Ruby on Rails (1)

• David Heinemeier Hanson (37signals)
• Yehuda Katz (Engine Yard)
* http://rubyonrails.org/
* http://www.rubyonrails.org.tw/ ( )

                    6
Ruby on Rails (2)
• A web framework for Ruby
• MVC architecture
• Agile software development
 - Don't Repeat Yourself.
 - Convention over Configuration.

                   7
Website using Rails
• BeLovely
• Techbang
• Twitter
• Github
• Tenlong
• Basecamp
• ......more   8
In general,

it takes a significant
investment of time to
learn Rails.

           9
Regular learning roadmap




                http://techiferous.com/2010/07/
                roadmap-for-learning-rails/
           10
But,


we now have another way in
the beginning.


            11
Rails basic
training course


      12
2010 Ruby on Rails
                                        Rails 2


• http://blog.xdite.net/?p=1754
 - http://blog.xdite.net/?p=1807
 - http://wildjcrt.pixnet.net/blog/post/
     26624950
*   This course is designed by xdite.


                     13
Course purpose
• Basic knowledge
  - git, editor, linux cli
• Useful services
  - CRUD, authentication, pagination,
    attachment files, admin backstage
• Bottleneck
  - rack, environment setting
                     14
Course 0: Git
• Open a project in github.
• Practice git useful commands.
 - pull, push, commit, branch, add, checkout,
    merge, status, diff, grep
* Peepcode Git Pro Git
* http://wildjcrt.pixnet.net/blog/post/
  26458848

                       15
Course 0: Editor
•   vgod                         Vim


    -   http://blog.vgod.tw/2009/12/08/vim-cheat-
        sheet-for-programmers/
* http://c9s.blogspot.com/2009/08/vim-hacks-
    coscup.html
* Oreilly            vi    vim
* Pragmatic       TextMate: Power Editing for the Mac

                           16
Course 0: Linux CLI


• Peepcode   Meet the Command Line
  Advanced Command Line




                  17
Reference before course
*   http://rails.pixnet.net/blog/category/list/1603567
*   http://wildjcrt.pixnet.net/blog/category/list/1431631
*   Ruby Programming —         Ruby
*   Ruby for Rails - Rails                  Ruby
*   The Well-Grounded Rubyist
*                Rails
*   Agile Web Development with Rails, Third Edition
*   The Rails Way
*   Ruby Pocket Reference
*   Rails Recipes
*   Advanced Rails Recipes: 84 New Ways to Build Stunning Rails Apps


                                       18
Course 1 (1)
• Create a new rails project.
• Setup configuration.
 - database.yml
 - .gitignore
• Push to github.
* http://rails.pixnet.net/blog/post/22953827
                      19
Course 1 (2)
• Complete a basic forum.
  - Forum model CRUD (scaffold)
  - Post model CRUD (scaffold)
  - Setting routes in this format :
     http://example.org/forums/1/posts/2
* http://rails.pixnet.net/blog/post/22956704
* http://ihower.tw/training/rails-tutoral.html
                       20
Course 2
• User can login / logout / signup.
 - Guest can view all posts.
 - Post needs to login forum.
 - User can only edit and destroy his own
    posts.
• Plugin: http://github.com/technoweenie/
  restful-authentication   DRY!


                     21
Course 3
•   Forum posts order and paginate.
    -   params, pagination
    -   counter_cache
    -   named_scope :recent
•   Plugin: http://github.com/mislav/will_paginate
*   http://railscasts.com/episodes/23-counter-cache-
    column
*   http://railscasts.com/episodes/108-named-scope

                             22
Course 4
• Attachment files
 - PostAttachment model
 - form_for, multipart
• Plugin: http://github.com/thoughtbot/paperclip
• Plugin: http://github.com/technoweenie/
  attachment_fu

                     23
Course 5
• Forum can manage admin accounts.
• Build backstage.
 - route : namespace
 - before_filter :require_is_admin
* http://railstips.org/blog/archives/2007/04/28/
  namespaces-added-to-routes/

                      24
Course 6
•   Rake
    -   create seed data
    -   create fake data
•   Plugin: http://github.com/ryanb/populator
*   http://railsenvy.com/2007/6/11/ruby-on-rails-rake-
    tutorial
*   http://ryandaigle.com/articles/2009/5/13/what-s-
    new-in-edge-rails-database-seeding

                           25
Course 7 (1)
• Installing Ruby on Rails environment in a
  pure OS (recommend Debian / Ubuntu).
  -   Ruby Enterprise Edition
  -   MySQL
  -   Apache / nginx
  -   Passenger
  -   Capistrano

                       26
Course 7 (2)
• Deploy the practice project.
 - Setup deploy.rb.
 - Create an account for deploy.
 - Setup ssh.
 - Setup database, run migration.
 - Setup virtual host.
                    27
Course 7 (3)

* http://wildjcrt.pixnet.net/blog/post/
  26624950
* http://blog.xdite.net/?p=1807
* AWDR3 deploy
* Ruby Pocket Reference capistrano

                      28
Another Rails Training( )

                           Ruby on Rails
 Ruby on Rails
 http://ihower.tw/        http://ihower.tw/
 rails2/                  rails3/       Rails3

                           *designed by ihower
                          http://ihower.tw/blog/

                     29
Related Link
•              Ruby on Rails? 2009
    -   http://rails.pixnet.net/blog/post/27997778
•              Ruby on Rails    2009
    -   http://rails.pixnet.net/blog/post/27997784
•   Rails
    -   http://wildjcrt.pixnet.net/blog/post/26784340
•                Rails
    -   http://wildjcrt.pixnet.net/blog/post/27037216
•   Rails                  from T
    -   https://gist.github.com/758319


                                    30
Working
experience


    31
Usual work
• Development
 - Ex: note on your photos, trying products,
    SSO, ...etc.
• Maintaining
 - Ex: crontab, daily backup, search
    index, ...etc.


                     32
Development new
        services
• Planning features in the service.
• Photoshop layout by art.
   - layout to HTML by art.
   - layout to Ralis by tech.

                      33
When tech get
    photoshop layout,
• Divided to many functional blocks. (tickets)
• Design models and schema by
  blocks. (paper and pen)

• Create new branch in git.
• Create Models and migrations.
• Apply to controllers and views.
                      34
You maybe need to

• write model method and helper methods.
• write jQuery.
• add your backstage services.

                   35
When tech get
       HTML layout

• Ex: http://show.channel.pixnet/index.html
• Divided into Rails layout.
• Combined your functional blocks with
  HTML and CSS.



                     36
Finally

• Deploy branch to staging.
• Test and feedback for adjustment.
• Repeat until service online.
• Merge master and deploy to production.

                    37
Example



   38
Plan - Main




     39
Plan - List




     40
Plan - Sticker




      41
Photoshop - Main




       42
Photoshop - List




       43
Photoshop - Sticker




         44
Tech - List (1)




       45
Tech - List (2)




       46
Tech - List (3)




       47
Tech - Sticker (1)




        48
Tech - Sticker (2)




        49
Tech - Sticker (3)




        50
Combination - Layout




         51
Combination - List (1)




          52
Combination - List (2)




          53
http://belovely.tw/event/perfect
               54
Q &A



 55

More Related Content

Similar to Master Ruby on Rails

Contributing to rails
Contributing to railsContributing to rails
Contributing to railsLukas Eppler
 
JRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudJRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudHiro Asari
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with RailsYi-Ting Cheng
 
Ship It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemShip It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemYi-Ting Cheng
 
Xitrum HOWTOs
Xitrum HOWTOsXitrum HOWTOs
Xitrum HOWTOsNgoc Dao
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsNETWAYS
 
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스Rhio Kim
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийVitebsk Miniq
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time rebootKentaro Goto
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Nilesh Panchal
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGuillaume Laforge
 
UPenn on Rails intro
UPenn on Rails introUPenn on Rails intro
UPenn on Rails introMat Schaffer
 
Qcon beijing 2010
Qcon beijing 2010Qcon beijing 2010
Qcon beijing 2010Vonbo
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure DataTaro L. Saito
 
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow Puppet
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflowTomas Doran
 
Culerity and Headless Full Stack Integration Testing
Culerity and Headless Full Stack Integration TestingCulerity and Headless Full Stack Integration Testing
Culerity and Headless Full Stack Integration TestingPatrick Huesler
 

Similar to Master Ruby on Rails (20)

Contributing to rails
Contributing to railsContributing to rails
Contributing to rails
 
JRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the CloudJRuby, Ruby, Rails and You on the Cloud
JRuby, Ruby, Rails and You on the Cloud
 
Rapid development with Rails
Rapid development with RailsRapid development with Rails
Rapid development with Rails
 
Ship It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails EcosystemShip It ! with Ruby/ Rails Ecosystem
Ship It ! with Ruby/ Rails Ecosystem
 
Ruby on rails
Ruby on railsRuby on rails
Ruby on rails
 
Xitrum HOWTOs
Xitrum HOWTOsXitrum HOWTOs
Xitrum HOWTOs
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy Hawkins
 
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
Node.js 기반 정적 페이지 블로그 엔진, 하루프레스
 
Redis
RedisRedis
Redis
 
Использование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложенийИспользование AzureDevOps при разработке микросервисных приложений
Использование AzureDevOps при разработке микросервисных приложений
 
Ruby in office time reboot
Ruby in office time rebootRuby in office time reboot
Ruby in office time reboot
 
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
Ruby on-rails-101-presentation-slides-for-a-five-day-introductory-course-1194...
 
Google App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and GaelykGoogle App Engine Java, Groovy and Gaelyk
Google App Engine Java, Groovy and Gaelyk
 
Publishing Linked Data from RDB
Publishing Linked Data from RDBPublishing Linked Data from RDB
Publishing Linked Data from RDB
 
UPenn on Rails intro
UPenn on Rails introUPenn on Rails intro
UPenn on Rails intro
 
Qcon beijing 2010
Qcon beijing 2010Qcon beijing 2010
Qcon beijing 2010
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
 
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow Puppet Camp New York 2014: Streamlining Puppet Development Workflow
Puppet Camp New York 2014: Streamlining Puppet Development Workflow
 
Steamlining your puppet development workflow
Steamlining your puppet development workflowSteamlining your puppet development workflow
Steamlining your puppet development workflow
 
Culerity and Headless Full Stack Integration Testing
Culerity and Headless Full Stack Integration TestingCulerity and Headless Full Stack Integration Testing
Culerity and Headless Full Stack Integration Testing
 

Recently uploaded

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 

Master Ruby on Rails

  • 1. Rails Ruby on Rails 1
  • 2. Who am I • I’m • Master: Ruby & Ruby on Rails • Company: PIXNET • Site: http://belovely.tw/ • Blog: http://wildjcrt.pixnet.net/ 2
  • 3. Agenda • Introduction Ruby on Rails • Rails basic training course • Working experience • Example 3
  • 5. Ruby • Matz • Perl 6 pearl Ruby 7 ruby * http://www.ruby-lang.org/en/ * http://www.ruby-lang.org/zh_TW/ ( ) * http://ruby.tw/ ( ) 5
  • 6. Ruby on Rails (1) • David Heinemeier Hanson (37signals) • Yehuda Katz (Engine Yard) * http://rubyonrails.org/ * http://www.rubyonrails.org.tw/ ( ) 6
  • 7. Ruby on Rails (2) • A web framework for Ruby • MVC architecture • Agile software development - Don't Repeat Yourself. - Convention over Configuration. 7
  • 8. Website using Rails • BeLovely • Techbang • Twitter • Github • Tenlong • Basecamp • ......more 8
  • 9. In general, it takes a significant investment of time to learn Rails. 9
  • 10. Regular learning roadmap http://techiferous.com/2010/07/ roadmap-for-learning-rails/ 10
  • 11. But, we now have another way in the beginning. 11
  • 13. 2010 Ruby on Rails Rails 2 • http://blog.xdite.net/?p=1754 - http://blog.xdite.net/?p=1807 - http://wildjcrt.pixnet.net/blog/post/ 26624950 * This course is designed by xdite. 13
  • 14. Course purpose • Basic knowledge - git, editor, linux cli • Useful services - CRUD, authentication, pagination, attachment files, admin backstage • Bottleneck - rack, environment setting 14
  • 15. Course 0: Git • Open a project in github. • Practice git useful commands. - pull, push, commit, branch, add, checkout, merge, status, diff, grep * Peepcode Git Pro Git * http://wildjcrt.pixnet.net/blog/post/ 26458848 15
  • 16. Course 0: Editor • vgod Vim - http://blog.vgod.tw/2009/12/08/vim-cheat- sheet-for-programmers/ * http://c9s.blogspot.com/2009/08/vim-hacks- coscup.html * Oreilly vi vim * Pragmatic TextMate: Power Editing for the Mac 16
  • 17. Course 0: Linux CLI • Peepcode Meet the Command Line Advanced Command Line 17
  • 18. Reference before course * http://rails.pixnet.net/blog/category/list/1603567 * http://wildjcrt.pixnet.net/blog/category/list/1431631 * Ruby Programming — Ruby * Ruby for Rails - Rails Ruby * The Well-Grounded Rubyist * Rails * Agile Web Development with Rails, Third Edition * The Rails Way * Ruby Pocket Reference * Rails Recipes * Advanced Rails Recipes: 84 New Ways to Build Stunning Rails Apps 18
  • 19. Course 1 (1) • Create a new rails project. • Setup configuration. - database.yml - .gitignore • Push to github. * http://rails.pixnet.net/blog/post/22953827 19
  • 20. Course 1 (2) • Complete a basic forum. - Forum model CRUD (scaffold) - Post model CRUD (scaffold) - Setting routes in this format : http://example.org/forums/1/posts/2 * http://rails.pixnet.net/blog/post/22956704 * http://ihower.tw/training/rails-tutoral.html 20
  • 21. Course 2 • User can login / logout / signup. - Guest can view all posts. - Post needs to login forum. - User can only edit and destroy his own posts. • Plugin: http://github.com/technoweenie/ restful-authentication DRY! 21
  • 22. Course 3 • Forum posts order and paginate. - params, pagination - counter_cache - named_scope :recent • Plugin: http://github.com/mislav/will_paginate * http://railscasts.com/episodes/23-counter-cache- column * http://railscasts.com/episodes/108-named-scope 22
  • 23. Course 4 • Attachment files - PostAttachment model - form_for, multipart • Plugin: http://github.com/thoughtbot/paperclip • Plugin: http://github.com/technoweenie/ attachment_fu 23
  • 24. Course 5 • Forum can manage admin accounts. • Build backstage. - route : namespace - before_filter :require_is_admin * http://railstips.org/blog/archives/2007/04/28/ namespaces-added-to-routes/ 24
  • 25. Course 6 • Rake - create seed data - create fake data • Plugin: http://github.com/ryanb/populator * http://railsenvy.com/2007/6/11/ruby-on-rails-rake- tutorial * http://ryandaigle.com/articles/2009/5/13/what-s- new-in-edge-rails-database-seeding 25
  • 26. Course 7 (1) • Installing Ruby on Rails environment in a pure OS (recommend Debian / Ubuntu). - Ruby Enterprise Edition - MySQL - Apache / nginx - Passenger - Capistrano 26
  • 27. Course 7 (2) • Deploy the practice project. - Setup deploy.rb. - Create an account for deploy. - Setup ssh. - Setup database, run migration. - Setup virtual host. 27
  • 28. Course 7 (3) * http://wildjcrt.pixnet.net/blog/post/ 26624950 * http://blog.xdite.net/?p=1807 * AWDR3 deploy * Ruby Pocket Reference capistrano 28
  • 29. Another Rails Training( ) Ruby on Rails Ruby on Rails http://ihower.tw/ http://ihower.tw/ rails2/ rails3/ Rails3 *designed by ihower http://ihower.tw/blog/ 29
  • 30. Related Link • Ruby on Rails? 2009 - http://rails.pixnet.net/blog/post/27997778 • Ruby on Rails 2009 - http://rails.pixnet.net/blog/post/27997784 • Rails - http://wildjcrt.pixnet.net/blog/post/26784340 • Rails - http://wildjcrt.pixnet.net/blog/post/27037216 • Rails from T - https://gist.github.com/758319 30
  • 32. Usual work • Development - Ex: note on your photos, trying products, SSO, ...etc. • Maintaining - Ex: crontab, daily backup, search index, ...etc. 32
  • 33. Development new services • Planning features in the service. • Photoshop layout by art. - layout to HTML by art. - layout to Ralis by tech. 33
  • 34. When tech get photoshop layout, • Divided to many functional blocks. (tickets) • Design models and schema by blocks. (paper and pen) • Create new branch in git. • Create Models and migrations. • Apply to controllers and views. 34
  • 35. You maybe need to • write model method and helper methods. • write jQuery. • add your backstage services. 35
  • 36. When tech get HTML layout • Ex: http://show.channel.pixnet/index.html • Divided into Rails layout. • Combined your functional blocks with HTML and CSS. 36
  • 37. Finally • Deploy branch to staging. • Test and feedback for adjustment. • Repeat until service online. • Merge master and deploy to production. 37
  • 38. Example 38
  • 45. Tech - List (1) 45
  • 46. Tech - List (2) 46
  • 47. Tech - List (3) 47
  • 48. Tech - Sticker (1) 48
  • 49. Tech - Sticker (2) 49
  • 50. Tech - Sticker (3) 50