More Pragmatic Patterns of Ruby on Rails at Kansai Ruby Kaigi #02

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

    4 Favorites

    More Pragmatic Patterns of Ruby on Rails at Kansai Ruby Kaigi #02 - Presentation Transcript

    1. 2009 11 7
    2. 2009 11 7
    3. 2009 11 7
    4. 2009 11 7
    5. 2009 11 7
    6. 2009 11 7
    7. 2009 11 7
    8. • http://www.kozuchi.net • http://github.com/everyleaf/kozuchi 2009 11 7
    9. 2009 11 7
    10. 2009 11 7
    11. 2009 11 7
    12. 2009 11 7
    13. 2009 11 7
    14. 2009 11 7
    15. 2009 11 7
    16. 2009 11 7
    17. 2009 11 7
    18. 2009 11 7
    19. 2009 11 7
    20. 2009 11 7
    21. 2009 11 7
    22. 2009 11 7
    23. 2009 11 7
    24. 2009 11 7
    25. 2009 11 7
    26. 2009 11 7
    27. 2009 11 7
    28. 2009 11 7
    29. 2009 11 7
    30. 2009 11 7
    31. 2009 11 7
    32. 2009 11 7
    33. 2009 11 7
    34. 2009 11 7
    35. 2009 11 7
    36. 2009 11 7
    37. 2009 11 7
    38. 2009 11 7
    39. 2009 11 7
    40. 2009 11 7
    41. class Book < ActiveRecord::Base validates_presence_of :title end 2009 11 7
    42. <%= error_messages_for :book %> 2009 11 7
    43. validate :check_title private def check_title errors.add(:title, 'Ruby !') unless title.to_s =~ /Ruby/ 2009 11 7 end
    44. 2009 11 7
    45. 2009 11 7
    46. 2009 11 7
    47. 2009 11 7
    48. 2009 11 7
    49. 2009 11 7
    50. 2009 11 7
    51. 2009 11 7
    52. 2009 11 7
    53. 2009 11 7
    54. 2009 11 7
    55. 2009 11 7
    56. 2009 11 7
    57. 2009 11 7
    58. 2009 11 7
    59. validate 2009 11 7
    60. 2009 11 7
    61. Validate 2009 11 7
    62. 2009 11 7
    63. 2009 11 7
    64. 2009 11 7
    65. validate 2009 11 7
    66. 2009 11 7
    67. before_save :check_parent_id private def check_parent_id return true unless parent raise “bad parent_id!” unless parent.user_id != user_id end 2009 11 7
    68. before_save :check_parent_id private def check_parent_id return true unless parent raise IllegalOperationError, “bad parent_id!” unless parent.user_id != user_id end 2009 11 7
    69. 2009 11 7
    70. 2009 11 7
    71. validate Controller 2009 11 7
    72. 2009 11 7
    73. 2009 11 7
    74. 2009 11 7
    75. 2009 11 7
    76. 2009 11 7
    77. 2009 11 7
    78. 2009 11 7
    79. Object save save save 2009 11 7
    80. Object save save save 2009 11 7
    81. Object save save save 2009 11 7
    82. validates_presence_of :description, :if => Proc.new {|o| !o.loose?} 2009 11 7
    83. 2009 11 7
    84. 2009 11 7
    85. 2009 11 7
    86. 2009 11 7
    87. 2009 11 7
    88. 2009 11 7
    89. 2009 11 7
    90. 2009 11 7
    91. 2009 11 7
    92. 2009 11 7
    93. Object callback callback callback callback callback callback callback 2009 11 7
    94. 2009 11 7
    95. 2009 11 7
    96. 2009 11 7
    97. 2009 11 7
    98. 2009 11 7
    99. 2009 11 7
    100. 2009 11 7
    101. 2009 11 7
    102. 2009 11 7
    103. 2009 11 7
    104. 2009 11 7
    105. 2009 11 7
    106. 2009 11 7
    107. 2009 11 7
    108. 2009 11 7
    109. 2009 11 7
    110. URL 2009 11 7
    111. 2009 11 7
    112. 2009 11 7
    113. map.resources aaaao a +option map.resource map.xxx map.connect 2009 11 7
    114. URL /groups GET index /groups POST create /groups/3 GET show /groups/3 PUT update /groups/3 DELETE destroy /groups/new GET new /groups/3/edit GET edit 2009 11 7
    115. map.resources :groups 2009 11 7
    116. 2009 11 7
    117. 2009 11 7
    118. 2009 11 7
    119. 2009 11 7
    120. 2009 11 7
    121. <%= link_to " ", groups_path %> 2009 11 7
    122. URL URL /groups GET index groups /groups POST create /groups/3 GET show /groups/3 group PUT update /groups/3 DELETE destroy /groups/new new_group GET new /groups/3/edit edit_group GET edit 2009 11 7
    123. <%= link_to " ", groups_path %> 2009 11 7
    124. 2009 11 7
    125. 2009 11 7
    126. 2009 11 7
    127. 2009 11 7
    128. URL URL /groups GET index groups /groups POST create /groups/3 GET show /groups/3 group PUT update /groups/3 DELETE destroy /groups/new new_group GET new /groups/3/edit edit_group GET edit 2009 11 7
    129. GET PUT / URL DELETE POST 2009 11 7
    130. URL URL /groups GET index groups /groups POST create /groups/3 GET show /groups/3 group PUT update /groups/3 DELETE destroy /groups/new new_group GET new /groups/3/edit edit_group GET edit 2009 11 7
    131. 2009 11 7
    132. 2009 11 7
    133. 2009 11 7
    134. 2009 11 7
    135. 2009 11 7
    136. 2009 11 7
    137. 2009 11 7
    138. map.resources aaaao a +option map.resource map.xxx map.connect 2009 11 7
    139. 2009 11 7
    140. 2009 11 7
    141. 2009 11 7
    142. map.with_options :path_prefix => 'books', :controller => 'books’ do |books| books.monthly_books ':year/:month', :action => 'monthly' books.daily_books ':year/:month/:date' :action => 'daily' end 2009 11 7
    143. map.with_options :controller => 'books' do |books| // BooksController end map.with_options :controller => 'authors' do |authors| // AuthorsController end 2009 11 7
    144. map.resources :diaries do |d| d.resources :comments end 2009 11 7
    145. 2009 11 7
    146. map.resources :diaries do |d| d.resources :comments end map.all_comments 'diaries/comments’, :controller => 'diary_comments’, :action => 'all_comments' 2009 11 7
    147. 2009 11 7
    148. 2009 11 7
    149. 2009 11 7
    150. 2009 11 7
    151. map.resources :diaries map.with_options :controller => 'diary_comments' do |dc| dc.resources :comments, :path_prefix => 'diary/:diary_id', :name_prefix => 'diary_’ dc.all_comments 'diaries/comments’, :action => 'all_comments' end 2009 11 7
    152. 2009 11 7
    153. 2009 11 7
    154. 2009 11 7
    155. 2009 11 7
    156. 2009 11 7
    157. 2009 11 7
    158. Tag Tagging 2009 11 7
    159. 2009 11 7
    160. BooksController TagService AuthorsController ReviewsController 2009 11 7
    161. 2009 11 7
    162. 2009 11 7
    163. 2009 11 7
    164. 2009 11 7
    165. 2009 11 7
    166. 2009 11 7
    167. 2009 11 7
    168. 2009 11 7
    169. 2009 11 7
    170. 2009 11 7
    171. 2009 11 7
    172. URL HTTP /books/edit GET edit_all /books PUT update_all /books DELETE destroy_all 2009 11 7
    173. URL HTTP /books/tags/edit GET edit_tags /books/tags PUT update_tags /books/tags DELETE destroy_tags 2009 11 7
    174. 2009 11 7
    175. 2009 11 7
    176. 2009 11 7
    177. 2009 11 7
    178. 2009 11 7
    179. 2009 11 7
    180. 2009 11 7
    SlideShare Zeitgeist 2009

    + naynay Nominate

    custom

    804 views, 4 favs, 1 embeds more stats

    The presentation document of a speech at Kansai Rub more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 804
      • 768 on SlideShare
      • 36 from embeds
    • Comments 0
    • Favorites 4
    • Downloads 8
    Most viewed embeds
    • 36 views on http://ko.meadowy.net

    more

    All embeds
    • 36 views on http://ko.meadowy.net

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

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

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories