Ruby on Rails in UbiSunrise

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Ruby on Rails in UbiSunrise - Presentation Transcript

    1. Ruby on Rails BY thegiive ( License by CC 2.0 )
    2. About me • ID : thegiive • SocialPicks.com • Ruby on Rails • Blog : http://lightyror.thegiive.net/ • Email : thegiive at gmail . com
    3. Outline • Ruby on Rails • Ruby on Rails • Rails • Active Record • • Active Record
    4. Ruby on Rails A 95.00 71.25 47.50 C B 23.75 0 6 7 8 9 10 11 12 1 2 3 4
    5. A 95.00 71.25 47.50 23.75 0 6 7 8 9 10 11 12 1 2 3 4
    6. Before Rails day 10% • PHP • • 90%
    7. After Rails day Survey Bloging • 2 PHP 10% Project 20% 40% • • 30%
    8. Phone time project • “ “ • 20 code • 3
    9. B 95.00 71.25 47.50 23.75 0 6 7 8 9 10 11 12 1 2 3 4
    10. • • • • •
    11. Coding RD Rails PHP 0 25 50 75 100
    12. C 95.00 71.25 47.50 23.75 0 6 7 8 9 10 11 12 1 2 3 4
    13. PS2 10
    14. After PS2 Day Blog Survey PS2 • 20% • 30% Project • 30% 10% 10%
    15. Ruby on Rails • MVC • Ruby • DHH Basecamp Project
    16. • David Heinemeier Hansson • DHH • 26 DHH Blog
    17. How Hot is Rails • Rails 2006 400 150 24 • 2005 Ruby on Rails 1500% 2006 700% • Ruby 26 13
    18. Rails Clone
    19. JAVA (Spring/Hibernate) Rails 4 (20 / )4 (5 /) 3293 1164 1161 113 Class/method 62/549 55/126 Justin Gehtland Blog
    20. • RD • • • Web Site • Performance
    21. ( • • • PS2
    22. • Justin Gehtland JAVA : Rails = 3.5 : 1 • Java : Rails = 25 : 1 • Proc.net PHP : Rails = 10 : 1 • JavaEye JAVA : Rails = 10 : 1 • PHP : Rails = 8 : 1 http://lightyror.blogspot.com/2006/10/rails.html
    23. Rails
    24. • ORM • Convention over Configuration • Don’t Repeat Yourself • Domain Specific Language
    25. ORM • Object Relational Mapping • • Propel Hibernate Active Record ...
    26. Convention over Configuration <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-mapping • PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.d <hibernate-mapping> <class name="test.hibernate.Order" table="orders"> <id name="id" type="string" unsaved-value="null" > <column name="id" sql-type="integer" not-null="true"/> <generator class="native"/> • </id> <key column="order_id" /> <one-to-many class="test.hibernate.OrderItem" /> </set> </class> </hibernate-mapping>
    27. DRY • Don’t Repeat Yourself • View Helper Partial DRY • Controller Module Lib DRY
    28. Domain Specific Language • Ruby DSL • Rails DB-Driven Web App DSL • has_one , has_many , HABTM • symbol ( :abc )
    29. Migration create_table :stores do |t| t.column :name , :string t.column :info , :text t.column :open_time , :string t.column :user_id , :integer t.column :created_at , :datetime t.column :updated_at , :datetime end
    30. Active Record • Rails • ORM • Convention over Configuration • 1:1 1:m n:m • MySQL SQL Server Oracle SQLite
    31. ORM Example a = People.new People id int a = People.find(1) name varchar phone varchar a.name = ‘David’ address text a.destroy sex enum a.save
    32. Relation Table Example Article People id int id int name varchar person_id int phone varchar title varchar address text content text sex enum created_at datatime
    33. Relation ORM a = People.find(1) a.articles a.articles.find(:first) a.articles << Article.new(...) Person a
    34. • • • Legacy • Template
    35. “ ” JAVA Python Perl
    36. Rails • ..... .... • DHH Ruby • Ruby DSL • •
    37. “ 20% JAVA 300% ” From Beyond Java
    38. Ruby ? • Ruby Programmming • Ruby is not Rails • Rails Ruby 60%
    39. City Neighbor id int city_id int neighbor_id int name varchar “ “ ” “ ” “
    40. • city n:m neighbor join table • •
    41. function (A B { if( B A ){ return ‘ ’ }else{ for ( A C { if( B C { return ‘ ’ } } return ‘ ’ Pseudo Code } }
    42. def check ( city_a , city_b ) if ( city_a.neighbors.include?(city_b) return ‘ ’ else city_a.neighbors.each do | neighbor_of_a | if (neighbor_of_a.neighbors.include?(city_b) ) return ‘ ’ end end return ‘ ’ Rails Code end end
    43. • Ubi • Topic •
    44. RoR * 1hr RoR in pratice * 3hr
    45. • • 10 • • Demo Code
    46. • • • Inspire by
    47. Code Stats • Code 270 • 230 • 40 • 80%
    48. • • Tag • Urmap • Search •
    49. Outline • • • • • Urmap API • Tag
    50. Live Demo RoR • • • Contagions
    51. Demo
    52. • Live Demo With Subversion • reversion • May the force be with me
    53. Stores Users id int id int user_id int Comments id int user_id int store_id int
    54. code • svn Committed revision 9.
    55. • Yullio Mollio plugin for Rails • layout • script/generate layout_yullio stores sidebar • Rails
    56. code • svn Committed revision 10. • sidebar : 11 • Store Layout : 12
    57. • Plugin • session • before_filter
    58. • •
    59. code • User : 13 • : 14
    60. • Rmagick • •
    61. file_column • Base on Rmagick • Rails • Upload
    62. code • : 15
    63. • Search Engine + Web API • Solr + act_as_solr • Ferret + ast_as_ferret
    64. SQL Search • Like ‘%....%’ • SQL code • Rails SQL
    65. code • Committed revision 16. • partial template
    66. Urmap API • • • UrMap API
    67. • • “ Hello 25 121 “ • GPS •
    68. ...
    69. Cron Script • ActiveRecord • Ruby HTTP POST
    70. code • Commit reversion 17
    71. Table Relationship • Active Record • console relationship
    72. code • Commit reversion 18 • ruby script/console
    73. Comment • •
    74. code • Commit reversion 19
    75. Tag • ast_as_taggable • model.tag_with('red library book') • model.tags
    76. code • Committed revision 20. • Committed revision 21
    77. • • •
    78. ?
    79. ?
    80. Q &A

    + thegiivethegiive, 3 years ago

    custom

    1984 views, 1 favs, 5 embeds more stats

    My Talk in UbiSunrise 4/22

    More Info

    © All Rights Reserved

    Go to text version
    • Total Views 1984
      • 1947 on SlideShare
      • 37 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 128
    Most viewed embeds
    • 32 views on http://lightyror.thegiive.net
    • 2 views on http://www.lonerunners.net
    • 1 views on http://www.zhuaxia.com
    • 1 views on http://72.14.203.104
    • 1 views on http://localhost

    more

    All embeds
    • 32 views on http://lightyror.thegiive.net
    • 2 views on http://www.lonerunners.net
    • 1 views on http://www.zhuaxia.com
    • 1 views on http://72.14.203.104
    • 1 views on http://localhost

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as innappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel

    Categories