Ksdg 使用 ruby on rails 快速打造你的 web app

download Ksdg   使用 ruby on rails 快速打造你的 web app

of 50

  • date post

    27-Aug-2014
  • Category

    Software

  • view

    460
  • download

    6

Embed Size (px)

description

Introduce ruby on rails

Transcript of Ksdg 使用 ruby on rails 快速打造你的 web app

  • Ruby on Rails Web APP http://goo.gl/Z7ID5I
  • Eddie Li Co-founder PHP / ZF1 / Web Security / Web Crawler / Ruby on Rails Blog: adz.visionbundles.com FB: latebird.ticket Email: eddie@visionbundles.com
  • ! RoR !
  • Rails () Convension Over Configuration
  • Rails () DRY (Dont Repeat Yourself)
  • Rails
  • Ruby Syntax
  • Ruby String & Symbol
  • Block
  • Rails PHP
  • Rails 1. coffeescript 2. sass / scss 3. pjax turbolinks 4. assets pipline 5. scaffold ()
  • Bundler Gem - , Library, Helper, Tools Bundler - Gem
  • Gem www.ruby-toolbox.com rubygems.org
  • Scaffold CRUD
  • MVC
  • 1. Migration 2. Model 3. RESTful style router controller 4. controller + 6 actions 5. View a. index.html.erb - b. edit.html.erb - c. new.html.erb - 7. assets file (coffee, scss) 8. Scaffold
  • . db schema code . id primary key . t.timestamp column a. updated_at => datetime b. created_at => datetime git checkout schema :) Migration 1
  • 1. rake db:create 2. rake db:migrate schema : Migration 2
  • schema_migrations 1. Migration File timestamp 2. schema 3. rake db:rollback schema Migration 3
  • : a. b. commit migration migrate & rollback c. migrate conflict Migration 4
  • Router resource REST Style URL 1. controller 7 actions 2. URL Helper View Router (Resource)
  • resource resource (yo!) : template pages URL : Router (Nested Resource)
  • resource URL HTLPER Router (URL Helper 1)
  • Router (URL Helper 2)
  • : 1 to 1 ( user profile) Router (Single Resource)
  • Model ( ORM) Model
  • Model ( db ) Table Column Attribute & Dirty Objects (instance method)
  • Model () P.S. model updated_at or created_at
  • Model ()
  • Model () scope - query function readable & maintainable mixin - model + DRY validator - Model Form () serialize - RDBMS Free schema callbacks - after_create, before_save, .. callback ..
  • Controller (index) 1/7
  • Controller (show, new, edit) 4/7
  • Controller (Create) 5/7
  • Controller (Update, Destroy) 7/7
  • View DB => Model => => Controller => View
  • 1. HTML 2. Excel 3. Dynamic Javascript 4. JSON 5. XML Views
  • router resource URL helper View Helper (form_for)
  • form_for 1. form template - bootstrap etc 2. input type - db column data type 3. - i18n, hints, label, error message display [gem] simple_form
  • [gem] client_side_validations model validate DRY Again
  • scaffold .
  • Gem 1. Devise - 10 2. omniauth - omniauth-facebook omniauth-twitter omniauth-github omniauth-renren omniauth-weibo
  • Gem 1. capybara-webkit - Ruby Webkit Driver 2. faye-websocket - Web Socket Server 3. rubcas-sever - cas protocol SSO Server
  • Ruby / RoR Project 1. Gitlab - self hosting github 2. Redmine - project management tool 3. Selfstarter - crowd-founding : http://www.opensourcerails.com/
  • Rails SaaS 1. Code Climate - code review 2. New Relic - server & app monitor
  • RoR
  • Q & A !!!!!!!!!!
  • VisionBundles Intl Ltd. / EC / Senior Ruby on Rails Web Developer () Senior F2E ()
  • Group: Kaohsiung Rails Meetup x http://goo.gl/VkkZAb