SlideShare une entreprise Scribd logo
1  sur  96
Télécharger pour lire hors ligne
Rails Tutorial
http://blog.xdite.net




http://handlino.com

 Rails Developer
Project Using Rails
               bingo.handlino.com



sudomake.com



                  VeryXD.net
Project Using Sinatra
                   MrIE6.com




             VeryXD.net
DRY
Don’t Repeat Yourself
Agenda
• ActiveRecord
• Template / Helper
• Library
• Plugin
Agenda
• ActiveRecord        Code

• Template / Helper
• Library
• Plugin
MVC
Model - View - Controller
MVC
Browser                                   Controller   Action
                                                                 Model-View-Controller
      HTTP request
                        route.rb
      GET /users/1


UsersController
                                                                Model
       def show
          @user = User.find(params[:id])
                                                                          Database
         respond_to do |format|
            format.html
            format.xml
         end
                                                                                  View
                                                       #show.html.erb
       end
                                                       <html>
       def index
                                                        <h1>User Profile</h1>
          ......
                                                        <p><%= @user.nickname %></p>
       end
                                                       </html>
end
C>M
C>M
 Code   Controller
Refactor to Model
  ActiveRecord   feature
ActiveRecord
• validation
• callback
• counter_cache
• named_scope
• STI
• polymorphic association
validation
validation



class Post < ActiveRecord::Base
  validates_presence_of :subject
end
validation



class Post < ActiveRecord::Base
  validates_presence_of :subject
end
validation
validation
 validates_exclusion_of :age, :in => 30..60

  validates_format_of :email, :with => /A([^@s]+)@((?:[-a-z0-9]+.)+[a-z]
{2,})Z/i, :on => :create

 validates_inclusion_of :format, :in => %w( jpg gif png )

 validates_length_of :phone, :in => 7..32, :allow_blank => true

 validates_uniqueness_of :teacher_id, :scope => [:semester_id, :class_id]
Callbacks


def create
  @post = Post.new(params[:post])
  @post.content += quot; < #{Time.now.to_s} >quot;
  if @post.save
    flash[:notice] = 'Post was successfully created.'
    redirect_to blog_path(@post)
  else
    render :action => quot;newquot;
  end
end
Callbacks
                                        before_create


class Post < ActiveRecord::Base

  before_create :insert_timestamp

  def insert_timestamp
    self.content += quot; < #{Time.now.to_s} >quot;
  end

end
Callbacks
    Create                         Update                   Destroy


before_validation             before_validation
before_validation_on_create   before_validation_on_update
after_validatin               after_validatin
after_validation_on_create    after_validation_on_upate
before_save                   before_save
before_create                 before_update                 before_destroy
 insert                          update                      delete
after_create                  after_update                  after_destroy
after_save                    after_save
Counter Cache
Counter Cache
class Comment < ActiveRecord::Base
  belongs_to :post

  def after_save
    self.update_counter_cache
  end

  def after_destroy
    self.update_counter_cache
  end

  def update_conter_cache
    self.post.comments_count = self.post.comments.size
    slf.post.save(false)
  end
end
Counter Cache
class Comment < ActiveRecord::Base
  belongs_to :post, :counter_cache => true
end



class PostCommentsCount < ActiveRecord::Migration
  def self.up
    add_column :posts, :comments_count, :integer , :default => 0
  end

  def self.down
    remove_column :posts,:comments_count
  end
end
Named Scope
                                                                    v.2.1
class Post < ActiveRecord::Base
  named_scope :publish, :conditions => { :is_blocked => false }
  named_scope :recent, :order => quot;created_at DESCquot;, :limit => 1
end



        Post.publish
        => SELECT * FROM `posts` WHERE (`posts`.`is_blocked` = 0)
        Post.recent
        => SELECT * FROM `posts` ORDER BY created_at DESC LIMIT 1
        Post.publish.recent
        => SELECT * FROM `posts` WHERE (`posts`.`is_blocked` = 0)
        ORDER BY created_at DESC LIMIT 1
STI (Single Table Inheritance )
 class Post < ActiveRecord::Base
   has_many :comments
   before_create :insert_timestamp

   def insert_timestamp
     self.content += quot; < #{Time.now.to_s} >quot;
   end

  named_scope :publish, :conditions => { :is_blocked => false }
  named_scope :recent, :order => quot;created_at DESCquot;, :limit => 1

 end



 class Article < Post
 end
Polymorphic Association
• Post has_many comments
• Photo has_many comments     Table    ?
• News has_many comments
                        post_comment
                        photo_comment
                        news_comment
Polymorphic Association
 class Post < ActiveRecord::Base
   has_many :comments, :as => :resource
 end

 class Comment < ActiveRecord::Base
   belongs_to :resource, :polymorphic => true
 end

 class PolymorphicComment < ActiveRecord::Migration
   def self.up
     remove_column :comments, :post_id
     add_column :comments, :resource_id, :integer
     add_column :comments, :resource_type, :string
   end

   def self.down
     add_column :comments, :post_id, :integer
     remove_column :comments, :resource_id
     remove_column :comments, :resource_type
   end
 end
Polymorphic Association
MVC
Model - View - Controller
V>C
V>C
 Code   View   ....
Less code in view
Render Template & Use Helper
View   code
Render Template


         partial
Render Template


         partial
Write Your Own Helper


                <td> <tr>
Write Your Own Helper
Don’t re-invent the wheel
   use the library ( lib/ ), gems
1        HTML +CSS (not flash)




    Yahoo Open Hack Day
lib/
rubygems
lib/
7326 gems
gems
Rapid Web Development
      vendor/plugin
1.
 authentication
restful-authentication
./script/generate authenticated user sessions --include-activation




•             /     /
• User model
• RESTful Session controller
• Activation mailer
open_id_authentication
•      OpenID
• openid session controller
• openid migration
openid_pack
• restful_authentication + open_id_authentication
                             OpenID ( multiple )
•
2. Model
  ActiveRecord
attachment_fu
has_attachment :storage => :file_system, :path_prefix => 'public/files',
                   :content_type => :image, :resize_to => [50,50]




 • model
 • File system / amazon S3 / Database store
restful_authenication
   attachment_fu
acts_as_taggable_on_steroids
•                    tagging
    class Post < ActiveRecord::Base
      acts_as_taggable
    end


    p = Post.find(:first)
    p.tag_list # []
    p.tag_list = quot;Funny, Sillyquot;
    p.save
    p.tag_list # [quot;Funnyquot;, quot;Sillyquot;]

    p.tag_list.add(quot;Greatquot;, quot;Awfulquot;)
    p.tag_list.remove(quot;Funnyquot;)
validates_url_of
    class Foo < ActiveRecord::Base
      validates_url_of :url, :message => 'is not valid or not responding'.t
    end




•             http://                            http://        https://
•
•
3. Controller&View
        ActionPack
will_paginate
•                                   HTML helper              CSS style

    @posts = Post.paginate :page => params[:page], :per_page => 50


      <ol>
        <% for post in @posts -%>
           <li>Render `post` in some nice way.</li>
        <% end -%>
      </ol>

      <%= will_paginate @posts %>
will_paginate (cont.)
 •                named_scope                                                              Rails 2.1
class Product < ActiveRecord::Base

 named_scope :cheap, :conditions => { :price => 0..5 }
 named_scope :recent, lambda { |*args| {:conditions => [quot;released_at > ?quot;, (args.first || 2.weeks.ago)]} }
 named_scope :visible, :include => :category, :conditions => { 'categories.hidden' => false }

end




 •
@products = Product.recent.cheap.paginate :page => params[:page], :per_page => 50
jRails
•             jQuery
    byebye! Prototype.js            gugod   hlb
facebox_render
• Facebox is a JQuery-based lightbox
  http://famspam.com/facebox/
facebox_render (cont.)
•               facebox
class ApplicationController < ActionController::Base
    include FaceboxRender
end
                           Text
facebox_render (cont.)
•                facebox
class ApplicationController < ActionController::Base
    include FaceboxRender
end
                            Text
    <%= facebox_link_to quot;Loginquot;, :url => new_session_url %>
facebox_render (cont.)
•                facebox
class ApplicationController < ActionController::Base
    include FaceboxRender
end
                            Text
    <%= facebox_link_to quot;Loginquot;, :url => new_session_url %>
facebox_render (cont.)
•                facebox
class ApplicationController < ActionController::Base
    include FaceboxRender
end
                            Text
    <%= facebox_link_to quot;Loginquot;, :url => new_session_url %>


                   def new
                    # do some thing you want
                    respond_to do |format|
                       format.html
                       format.js { render_facebox }
                    end
                   end
facebox_render (cont.)
•                facebox
class ApplicationController < ActionController::Base
    include FaceboxRender
end
                            Text
    <%= facebox_link_to quot;Loginquot;, :url => new_session_url %>


                   def new
                    # do some thing you want
                    respond_to do |format|
                       format.html
                       format.js { render_facebox }
                    end
                   end
Ajax form submit
Ajax form submit
<% form_remote_tag :url => batch_event_attendees_path(@event) do %>


                                        Ajax form submit
def batch
        ...
        respond_to do |format|
            format.html
            format.js { render_to_facebox }
        end
       end




Text
def batch
        ...
        respond_to do |format|
            format.html
            format.js { render_to_facebox }
        end
       end




Text
def batch
        ...
        respond_to do |format|
            format.html
            format.js { render_to_facebox }
        end
       end



             batch.html.erb

Text
def batch
        ...
        respond_to do |format|
            format.html
            format.js { render_to_facebox }
        end
       end



             batch.html.erb

Text
stickies
•                    flash[:notice]
•                                                           CSS
     style        Javascript close
    error_stickie(quot;Your account has been disabledquot;)
    warning_stickie(quot;Your account will expire in 3 daysquot;)
    notice_stickie(quot;Account activatedquot;)
    debug_stickie(quot;This only works when RAILS_ENV is developmentquot;)




    <%= render_stickies %>
4.
     deployment
ar_mailer
•                  E-mail
       E-mail                       Class EventNotifier < ActionMailer::ARMailer

                                      def signup_notification(user)
                                        ...
                                      end

                                    end


UserNotifier.deliver_signup_notification(@user)




                                                                      ar_sendmail
              Database                                                  daemon
hoptoad
•   exception      (500 error)
•         log
New Relic
• profiling your rails app
• trace code stack
• provide optimize direction
Capistrano
                                                                     deploy
1. ssh to production server
2. svn checkout
3. run some your script (link file/copy config file/ clear cache…etc)
4. restart mongrel cluster
plugin   ?
thank you.
Bonus
I18n
less pain( Rails 2.2 )
session
  yml
Template & Engine
Ultima lazy solution ( Rails 2.3)
Template
•
•                            gem / plugin
•                        route / rake
• ...                    ?
• ......       by case
• ..........   =_=
Templates


• (restful / openid / twitter) _authenication
• Facebook
• Google App Engine
Engine
•
• MVC                    code
• ...                    copy
• ......       by case
• ..........   =_=
Twitter
   XD
Twitter
   XD
Engine                 plugin

   •     Application
           Plugin
   •                   code


   • Load
   •              code
thanks again.


   http://blog.xdite.net
   http://twitter.com/xdite

Contenu connexe

Tendances

Php Unit With Zend Framework Zendcon09
Php Unit With Zend Framework   Zendcon09Php Unit With Zend Framework   Zendcon09
Php Unit With Zend Framework Zendcon09Michelangelo van Dam
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Librariesjeresig
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overviewYehuda Katz
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4Javier Eguiluz
 
How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksCompare Infobase Limited
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2Javier Eguiluz
 
2012.sandiego.wordcamp
2012.sandiego.wordcamp2012.sandiego.wordcamp
2012.sandiego.wordcampBrandon Dove
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Codescidept
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesBrandon Dove
 
Creating GUI Component APIs in Angular and Web Components
Creating GUI Component APIs in Angular and Web ComponentsCreating GUI Component APIs in Angular and Web Components
Creating GUI Component APIs in Angular and Web ComponentsRachael L Moore
 
5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniternicdev
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Sumy PHP User Grpoup
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenarioArnauld Loyer
 
Layouts and Rendering in Rails, Season 2
Layouts and Rendering in Rails, Season 2Layouts and Rendering in Rails, Season 2
Layouts and Rendering in Rails, Season 2RORLAB
 
15.exemplu complet eloquent view add-edit-delete-search
15.exemplu complet eloquent view add-edit-delete-search15.exemplu complet eloquent view add-edit-delete-search
15.exemplu complet eloquent view add-edit-delete-searchRazvan Raducanu, PhD
 
Creating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web ComponentsCreating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web ComponentsRachael L Moore
 
Servlet and jsp interview questions
Servlet and jsp interview questionsServlet and jsp interview questions
Servlet and jsp interview questionsSujata Regoti
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />tutorialsruby
 

Tendances (20)

Php Unit With Zend Framework Zendcon09
Php Unit With Zend Framework   Zendcon09Php Unit With Zend Framework   Zendcon09
Php Unit With Zend Framework Zendcon09
 
More Secrets of JavaScript Libraries
More Secrets of JavaScript LibrariesMore Secrets of JavaScript Libraries
More Secrets of JavaScript Libraries
 
Rails 3 overview
Rails 3 overviewRails 3 overview
Rails 3 overview
 
Curso Symfony - Clase 4
Curso Symfony - Clase 4Curso Symfony - Clase 4
Curso Symfony - Clase 4
 
How do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML TricksHow do speed up web pages? CSS & HTML Tricks
How do speed up web pages? CSS & HTML Tricks
 
Curso Symfony - Clase 2
Curso Symfony - Clase 2Curso Symfony - Clase 2
Curso Symfony - Clase 2
 
Basics of AngularJS
Basics of AngularJSBasics of AngularJS
Basics of AngularJS
 
2012.sandiego.wordcamp
2012.sandiego.wordcamp2012.sandiego.wordcamp
2012.sandiego.wordcamp
 
Working Effectively With Legacy Code
Working Effectively With Legacy CodeWorking Effectively With Legacy Code
Working Effectively With Legacy Code
 
WordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin PagesWordPress Admin UI - Future Proofing Your Admin Pages
WordPress Admin UI - Future Proofing Your Admin Pages
 
Creating GUI Component APIs in Angular and Web Components
Creating GUI Component APIs in Angular and Web ComponentsCreating GUI Component APIs in Angular and Web Components
Creating GUI Component APIs in Angular and Web Components
 
5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter5 Reasons To Love CodeIgniter
5 Reasons To Love CodeIgniter
 
Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2Service approach for development Rest API in Symfony2
Service approach for development Rest API in Symfony2
 
BDD - Writing better scenario
BDD - Writing better scenarioBDD - Writing better scenario
BDD - Writing better scenario
 
Layouts and Rendering in Rails, Season 2
Layouts and Rendering in Rails, Season 2Layouts and Rendering in Rails, Season 2
Layouts and Rendering in Rails, Season 2
 
15.exemplu complet eloquent view add-edit-delete-search
15.exemplu complet eloquent view add-edit-delete-search15.exemplu complet eloquent view add-edit-delete-search
15.exemplu complet eloquent view add-edit-delete-search
 
Creating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web ComponentsCreating GUI container components in Angular and Web Components
Creating GUI container components in Angular and Web Components
 
Makezine
MakezineMakezine
Makezine
 
Servlet and jsp interview questions
Servlet and jsp interview questionsServlet and jsp interview questions
Servlet and jsp interview questions
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 

En vedette

Автоматизация при разработке мобильных приложений
Автоматизация при разработке мобильных приложенийАвтоматизация при разработке мобильных приложений
Автоматизация при разработке мобильных приложенийSQALab
 
Intro to Rails Workshop ( TA 須知 )
Intro to Rails Workshop ( TA 須知 )Intro to Rails Workshop ( TA 須知 )
Intro to Rails Workshop ( TA 須知 )Yi-Ting Cheng
 
Lean UX Anti-Patterns
Lean UX Anti-PatternsLean UX Anti-Patterns
Lean UX Anti-PatternsBill Scott
 
RubyConf 2010 Keynote by Matz
RubyConf 2010 Keynote by MatzRubyConf 2010 Keynote by Matz
RubyConf 2010 Keynote by Matzyukihiro_matz
 
The Lean Tech Stack
The Lean Tech StackThe Lean Tech Stack
The Lean Tech StackBill Scott
 

En vedette (20)

Автоматизация при разработке мобильных приложений
Автоматизация при разработке мобильных приложенийАвтоматизация при разработке мобильных приложений
Автоматизация при разработке мобильных приложений
 
Ec2onrails
Ec2onrailsEc2onrails
Ec2onrails
 
Upgrading to rails3
Upgrading to rails3Upgrading to rails3
Upgrading to rails3
 
Pp6-xdite
Pp6-xditePp6-xdite
Pp6-xdite
 
Intro to Rails Workshop ( TA 須知 )
Intro to Rails Workshop ( TA 須知 )Intro to Rails Workshop ( TA 須知 )
Intro to Rails Workshop ( TA 須知 )
 
From The Christmas Heart
From The  Christmas  HeartFrom The  Christmas  Heart
From The Christmas Heart
 
Los Niños no Olvidan. Parte 4
Los Niños no Olvidan. Parte 4Los Niños no Olvidan. Parte 4
Los Niños no Olvidan. Parte 4
 
Los Niños no Olvidan. Parte 5
Los Niños no Olvidan. Parte 5 Los Niños no Olvidan. Parte 5
Los Niños no Olvidan. Parte 5
 
Presenter's tools: Software & Hardware
Presenter's tools: Software & HardwarePresenter's tools: Software & Hardware
Presenter's tools: Software & Hardware
 
Very Xd
Very XdVery Xd
Very Xd
 
2016 01 07-part2
2016 01 07-part22016 01 07-part2
2016 01 07-part2
 
Plastic Surgery of a Presentation
Plastic Surgery of a PresentationPlastic Surgery of a Presentation
Plastic Surgery of a Presentation
 
Understanding Stem Cells
Understanding Stem CellsUnderstanding Stem Cells
Understanding Stem Cells
 
Numbers You Did'nt Know on Cell Phones
Numbers You Did'nt Know on Cell PhonesNumbers You Did'nt Know on Cell Phones
Numbers You Did'nt Know on Cell Phones
 
2016 01 07 part 1
2016 01 07 part 12016 01 07 part 1
2016 01 07 part 1
 
2016 01 09 NPS - 63
2016 01 09 NPS - 632016 01 09 NPS - 63
2016 01 09 NPS - 63
 
Animal timing. Animal rights
Animal timing. Animal rightsAnimal timing. Animal rights
Animal timing. Animal rights
 
Lean UX Anti-Patterns
Lean UX Anti-PatternsLean UX Anti-Patterns
Lean UX Anti-Patterns
 
RubyConf 2010 Keynote by Matz
RubyConf 2010 Keynote by MatzRubyConf 2010 Keynote by Matz
RubyConf 2010 Keynote by Matz
 
The Lean Tech Stack
The Lean Tech StackThe Lean Tech Stack
The Lean Tech Stack
 

Similaire à OSDC 2009 Rails Turtorial

Ruby on rails
Ruby on rails Ruby on rails
Ruby on rails Mohit Jain
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?brynary
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkDirk Haun
 
Cache Money Talk: Practical Application
Cache Money Talk: Practical ApplicationCache Money Talk: Practical Application
Cache Money Talk: Practical ApplicationWolfram Arnold
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Phpfunkatron
 
Intro to Rails ActiveRecord
Intro to Rails ActiveRecordIntro to Rails ActiveRecord
Intro to Rails ActiveRecordMark Menard
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatternsChul Ju Hong
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-publicChul Ju Hong
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsJohn Brunswick
 
Clearance: Simple, complete Ruby web app authentication.
Clearance: Simple, complete Ruby web app authentication.Clearance: Simple, complete Ruby web app authentication.
Clearance: Simple, complete Ruby web app authentication.Jason Morrison
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on RailsMark Menard
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On RailsWen-Tien Chang
 
Ride on the Fast Track of Web with Ruby on Rails- Part 2
Ride on the Fast Track of Web with Ruby on Rails- Part 2Ride on the Fast Track of Web with Ruby on Rails- Part 2
Ride on the Fast Track of Web with Ruby on Rails- Part 2A.K.M. Ahsrafuzzaman
 
More to RoC weibo
More to RoC weiboMore to RoC weibo
More to RoC weiboshaokun
 
Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009bturnbull
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2fishwarter
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2fishwarter
 
Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel Engine Yard
 
Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Compare Infobase Limited
 

Similaire à OSDC 2009 Rails Turtorial (20)

Ruby on rails
Ruby on rails Ruby on rails
Ruby on rails
 
What's new in Rails 2?
What's new in Rails 2?What's new in Rails 2?
What's new in Rails 2?
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
Cache Money Talk: Practical Application
Cache Money Talk: Practical ApplicationCache Money Talk: Practical Application
Cache Money Talk: Practical Application
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Intro to Rails ActiveRecord
Intro to Rails ActiveRecordIntro to Rails ActiveRecord
Intro to Rails ActiveRecord
 
Rails antipatterns
Rails antipatternsRails antipatterns
Rails antipatterns
 
Rails antipattern-public
Rails antipattern-publicRails antipattern-public
Rails antipattern-public
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
 
Clearance: Simple, complete Ruby web app authentication.
Clearance: Simple, complete Ruby web app authentication.Clearance: Simple, complete Ruby web app authentication.
Clearance: Simple, complete Ruby web app authentication.
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 
Building Web Interface On Rails
Building Web Interface On RailsBuilding Web Interface On Rails
Building Web Interface On Rails
 
Jsf Ajax
Jsf AjaxJsf Ajax
Jsf Ajax
 
Ride on the Fast Track of Web with Ruby on Rails- Part 2
Ride on the Fast Track of Web with Ruby on Rails- Part 2Ride on the Fast Track of Web with Ruby on Rails- Part 2
Ride on the Fast Track of Web with Ruby on Rails- Part 2
 
More to RoC weibo
More to RoC weiboMore to RoC weibo
More to RoC weibo
 
Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009Rails 2.3 and Rack - NHRuby Feb 2009
Rails 2.3 and Rack - NHRuby Feb 2009
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel Rails Antipatterns | Open Session with Chad Pytel
Rails Antipatterns | Open Session with Chad Pytel
 
Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation Zend - Installation And Sample Project Creation
Zend - Installation And Sample Project Creation
 

Plus de Yi-Ting Cheng

莫拉克颱風災情支援網
莫拉克颱風災情支援網莫拉克颱風災情支援網
莫拉克颱風災情支援網Yi-Ting Cheng
 
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
 
Scaling Rails Sites by default
Scaling Rails Sites by defaultScaling Rails Sites by default
Scaling Rails Sites by defaultYi-Ting Cheng
 
Sinatra Introduction
Sinatra IntroductionSinatra Introduction
Sinatra IntroductionYi-Ting Cheng
 

Plus de Yi-Ting Cheng (10)

農家樂 Agricola
農家樂 Agricola農家樂 Agricola
農家樂 Agricola
 
莫拉克颱風災情支援網
莫拉克颱風災情支援網莫拉克颱風災情支援網
莫拉克颱風災情支援網
 
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
 
Scaling Rails Sites by default
Scaling Rails Sites by defaultScaling Rails Sites by default
Scaling Rails Sites by default
 
Sinatra Introduction
Sinatra IntroductionSinatra Introduction
Sinatra Introduction
 
Rails21v2
Rails21v2Rails21v2
Rails21v2
 
Very Xd Hw9
Very Xd Hw9Very Xd Hw9
Very Xd Hw9
 
Happyweb8 Encode
Happyweb8 EncodeHappyweb8 Encode
Happyweb8 Encode
 
Happyweb8 Encode
Happyweb8 EncodeHappyweb8 Encode
Happyweb8 Encode
 

Dernier

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 

Dernier (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

OSDC 2009 Rails Turtorial

  • 3. Project Using Rails bingo.handlino.com sudomake.com VeryXD.net
  • 4. Project Using Sinatra MrIE6.com VeryXD.net
  • 6. Agenda • ActiveRecord • Template / Helper • Library • Plugin
  • 7. Agenda • ActiveRecord Code • Template / Helper • Library • Plugin
  • 8. MVC Model - View - Controller
  • 9. MVC Browser Controller Action Model-View-Controller HTTP request route.rb GET /users/1 UsersController Model def show @user = User.find(params[:id]) Database respond_to do |format| format.html format.xml end View #show.html.erb end <html> def index <h1>User Profile</h1> ...... <p><%= @user.nickname %></p> end </html> end
  • 10. C>M
  • 11. C>M Code Controller
  • 12. Refactor to Model ActiveRecord feature
  • 13. ActiveRecord • validation • callback • counter_cache • named_scope • STI • polymorphic association
  • 15. validation class Post < ActiveRecord::Base validates_presence_of :subject end
  • 16. validation class Post < ActiveRecord::Base validates_presence_of :subject end
  • 18. validation validates_exclusion_of :age, :in => 30..60 validates_format_of :email, :with => /A([^@s]+)@((?:[-a-z0-9]+.)+[a-z] {2,})Z/i, :on => :create validates_inclusion_of :format, :in => %w( jpg gif png ) validates_length_of :phone, :in => 7..32, :allow_blank => true validates_uniqueness_of :teacher_id, :scope => [:semester_id, :class_id]
  • 19. Callbacks def create @post = Post.new(params[:post]) @post.content += quot; < #{Time.now.to_s} >quot; if @post.save flash[:notice] = 'Post was successfully created.' redirect_to blog_path(@post) else render :action => quot;newquot; end end
  • 20. Callbacks before_create class Post < ActiveRecord::Base before_create :insert_timestamp def insert_timestamp self.content += quot; < #{Time.now.to_s} >quot; end end
  • 21. Callbacks Create Update Destroy before_validation before_validation before_validation_on_create before_validation_on_update after_validatin after_validatin after_validation_on_create after_validation_on_upate before_save before_save before_create before_update before_destroy insert update delete after_create after_update after_destroy after_save after_save
  • 23. Counter Cache class Comment < ActiveRecord::Base belongs_to :post def after_save self.update_counter_cache end def after_destroy self.update_counter_cache end def update_conter_cache self.post.comments_count = self.post.comments.size slf.post.save(false) end end
  • 24. Counter Cache class Comment < ActiveRecord::Base belongs_to :post, :counter_cache => true end class PostCommentsCount < ActiveRecord::Migration def self.up add_column :posts, :comments_count, :integer , :default => 0 end def self.down remove_column :posts,:comments_count end end
  • 25. Named Scope v.2.1 class Post < ActiveRecord::Base named_scope :publish, :conditions => { :is_blocked => false } named_scope :recent, :order => quot;created_at DESCquot;, :limit => 1 end Post.publish => SELECT * FROM `posts` WHERE (`posts`.`is_blocked` = 0) Post.recent => SELECT * FROM `posts` ORDER BY created_at DESC LIMIT 1 Post.publish.recent => SELECT * FROM `posts` WHERE (`posts`.`is_blocked` = 0) ORDER BY created_at DESC LIMIT 1
  • 26. STI (Single Table Inheritance ) class Post < ActiveRecord::Base has_many :comments before_create :insert_timestamp def insert_timestamp self.content += quot; < #{Time.now.to_s} >quot; end named_scope :publish, :conditions => { :is_blocked => false } named_scope :recent, :order => quot;created_at DESCquot;, :limit => 1 end class Article < Post end
  • 27. Polymorphic Association • Post has_many comments • Photo has_many comments Table ? • News has_many comments post_comment photo_comment news_comment
  • 28. Polymorphic Association class Post < ActiveRecord::Base has_many :comments, :as => :resource end class Comment < ActiveRecord::Base belongs_to :resource, :polymorphic => true end class PolymorphicComment < ActiveRecord::Migration def self.up remove_column :comments, :post_id add_column :comments, :resource_id, :integer add_column :comments, :resource_type, :string end def self.down add_column :comments, :post_id, :integer remove_column :comments, :resource_id remove_column :comments, :resource_type end end
  • 30. MVC Model - View - Controller
  • 31. V>C
  • 32. V>C Code View ....
  • 33. Less code in view Render Template & Use Helper
  • 34. View code
  • 35. Render Template partial
  • 36. Render Template partial
  • 37.
  • 38.
  • 39. Write Your Own Helper <td> <tr>
  • 40. Write Your Own Helper
  • 41.
  • 42.
  • 43. Don’t re-invent the wheel use the library ( lib/ ), gems
  • 44. 1 HTML +CSS (not flash) Yahoo Open Hack Day
  • 46. lib/
  • 48. gems
  • 49. Rapid Web Development vendor/plugin
  • 51. restful-authentication ./script/generate authenticated user sessions --include-activation • / / • User model • RESTful Session controller • Activation mailer
  • 52. open_id_authentication • OpenID • openid session controller • openid migration
  • 53. openid_pack • restful_authentication + open_id_authentication OpenID ( multiple ) •
  • 54. 2. Model ActiveRecord
  • 55. attachment_fu has_attachment :storage => :file_system, :path_prefix => 'public/files', :content_type => :image, :resize_to => [50,50] • model • File system / amazon S3 / Database store
  • 56. restful_authenication attachment_fu
  • 57. acts_as_taggable_on_steroids • tagging class Post < ActiveRecord::Base acts_as_taggable end p = Post.find(:first) p.tag_list # [] p.tag_list = quot;Funny, Sillyquot; p.save p.tag_list # [quot;Funnyquot;, quot;Sillyquot;] p.tag_list.add(quot;Greatquot;, quot;Awfulquot;) p.tag_list.remove(quot;Funnyquot;)
  • 58.
  • 59. validates_url_of class Foo < ActiveRecord::Base validates_url_of :url, :message => 'is not valid or not responding'.t end • http:// http:// https:// • •
  • 60. 3. Controller&View ActionPack
  • 61. will_paginate • HTML helper CSS style @posts = Post.paginate :page => params[:page], :per_page => 50 <ol> <% for post in @posts -%> <li>Render `post` in some nice way.</li> <% end -%> </ol> <%= will_paginate @posts %>
  • 62. will_paginate (cont.) • named_scope Rails 2.1 class Product < ActiveRecord::Base named_scope :cheap, :conditions => { :price => 0..5 } named_scope :recent, lambda { |*args| {:conditions => [quot;released_at > ?quot;, (args.first || 2.weeks.ago)]} } named_scope :visible, :include => :category, :conditions => { 'categories.hidden' => false } end • @products = Product.recent.cheap.paginate :page => params[:page], :per_page => 50
  • 63. jRails • jQuery byebye! Prototype.js gugod hlb
  • 64. facebox_render • Facebox is a JQuery-based lightbox http://famspam.com/facebox/
  • 65. facebox_render (cont.) • facebox class ApplicationController < ActionController::Base include FaceboxRender end Text
  • 66. facebox_render (cont.) • facebox class ApplicationController < ActionController::Base include FaceboxRender end Text <%= facebox_link_to quot;Loginquot;, :url => new_session_url %>
  • 67. facebox_render (cont.) • facebox class ApplicationController < ActionController::Base include FaceboxRender end Text <%= facebox_link_to quot;Loginquot;, :url => new_session_url %>
  • 68. facebox_render (cont.) • facebox class ApplicationController < ActionController::Base include FaceboxRender end Text <%= facebox_link_to quot;Loginquot;, :url => new_session_url %> def new # do some thing you want respond_to do |format| format.html format.js { render_facebox } end end
  • 69. facebox_render (cont.) • facebox class ApplicationController < ActionController::Base include FaceboxRender end Text <%= facebox_link_to quot;Loginquot;, :url => new_session_url %> def new # do some thing you want respond_to do |format| format.html format.js { render_facebox } end end
  • 72. <% form_remote_tag :url => batch_event_attendees_path(@event) do %> Ajax form submit
  • 73. def batch ... respond_to do |format| format.html format.js { render_to_facebox } end end Text
  • 74. def batch ... respond_to do |format| format.html format.js { render_to_facebox } end end Text
  • 75. def batch ... respond_to do |format| format.html format.js { render_to_facebox } end end batch.html.erb Text
  • 76. def batch ... respond_to do |format| format.html format.js { render_to_facebox } end end batch.html.erb Text
  • 77. stickies • flash[:notice] • CSS style Javascript close error_stickie(quot;Your account has been disabledquot;) warning_stickie(quot;Your account will expire in 3 daysquot;) notice_stickie(quot;Account activatedquot;) debug_stickie(quot;This only works when RAILS_ENV is developmentquot;) <%= render_stickies %>
  • 78. 4. deployment
  • 79. ar_mailer • E-mail E-mail Class EventNotifier < ActionMailer::ARMailer def signup_notification(user) ... end end UserNotifier.deliver_signup_notification(@user) ar_sendmail Database daemon
  • 80. hoptoad • exception (500 error) • log
  • 81. New Relic • profiling your rails app • trace code stack • provide optimize direction
  • 82. Capistrano deploy 1. ssh to production server 2. svn checkout 3. run some your script (link file/copy config file/ clear cache…etc) 4. restart mongrel cluster
  • 83. plugin ?
  • 85. Bonus
  • 87.
  • 89. Template & Engine Ultima lazy solution ( Rails 2.3)
  • 90. Template • • gem / plugin • route / rake • ... ? • ...... by case • .......... =_=
  • 91. Templates • (restful / openid / twitter) _authenication • Facebook • Google App Engine
  • 92. Engine • • MVC code • ... copy • ...... by case • .......... =_=
  • 93. Twitter XD
  • 94. Twitter XD
  • 95. Engine plugin • Application Plugin • code • Load • code
  • 96. thanks again. http://blog.xdite.net http://twitter.com/xdite