SlideShare une entreprise Scribd logo
1  sur  107
Télécharger pour lire hors ligne
class User < ActiveRecord::Base
end
class User < ActiveRecord::Base
    has_many :books
end
class User < ActiveRecord::Base
    set_table_name 'user'
    set_primary_key 'pkey'
end
ITPro
View
 Controller
Model
      Rails
    mongrel
View



    Controller


Model
View



    Controller


Model

                        URL
             params[]
View



    Controller

                          URL
Model

                        URL
             params[]
View



    Controller
   Model.find,model.save
                          URL
Model

                        URL
             params[]
View



    Controller
   Model.find,model.save
                          URL
Model

                        URL
             params[]
View



    Controller
   Model.find,model.save
                          URL
Model

                        URL
             params[]
app/models/todo.rb




description
Rails User model associations and configuration
Rails User model associations and configuration
Rails User model associations and configuration

Contenu connexe

Tendances

Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Andolasoft Inc
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginnersMunir Hoque
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JSBipin
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation Phan Tuan
 
Ruby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapRuby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapMarcio Marinho
 
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
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architectureGabriele Falace
 
AngularJS introduction
AngularJS introductionAngularJS introduction
AngularJS introductionTania Gonzales
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architectureMichael He
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesMarios Fakiolas
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves railsMichael He
 

Tendances (20)

Angular2 - In Action
Angular2  - In ActionAngular2  - In Action
Angular2 - In Action
 
Angular meetup
Angular meetupAngular meetup
Angular meetup
 
AngularJS Best Practices
AngularJS Best PracticesAngularJS Best Practices
AngularJS Best Practices
 
Angular js
Angular jsAngular js
Angular js
 
Ajax pagination using j query in rails3
Ajax pagination using j query in rails3Ajax pagination using j query in rails3
Ajax pagination using j query in rails3
 
Angular JS
Angular JSAngular JS
Angular JS
 
Angular js for beginners
Angular js for beginnersAngular js for beginners
Angular js for beginners
 
Angular js
Angular jsAngular js
Angular js
 
Front end development with Angular JS
Front end development with Angular JSFront end development with Angular JS
Front end development with Angular JS
 
AngularJs presentation
AngularJs presentation AngularJs presentation
AngularJs presentation
 
Ruby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter BootstrapRuby on Rails + AngularJS + Twitter Bootstrap
Ruby on Rails + AngularJS + Twitter Bootstrap
 
Angular js
Angular jsAngular js
Angular js
 
The AngularJS way
The AngularJS wayThe AngularJS way
The AngularJS way
 
5 angularjs features
5 angularjs features5 angularjs features
5 angularjs features
 
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
 
AngularJS application architecture
AngularJS application architectureAngularJS application architecture
AngularJS application architecture
 
AngularJS introduction
AngularJS introductionAngularJS introduction
AngularJS introduction
 
Angularjs architecture
Angularjs architectureAngularjs architecture
Angularjs architecture
 
Get rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directivesGet rid of controllers in angular 1.5.x start using component directives
Get rid of controllers in angular 1.5.x start using component directives
 
How angularjs saves rails
How angularjs saves railsHow angularjs saves rails
How angularjs saves rails
 

En vedette

Te Que Prohibido Lo Siguiente
Te Que Prohibido Lo SiguienteTe Que Prohibido Lo Siguiente
Te Que Prohibido Lo Siguientefedericoblanco
 
Apresentacao: Memorias de Mario Araujo - de Cabaceiras a Campina Grande
Apresentacao: Memorias de Mario Araujo - de Cabaceiras a Campina GrandeApresentacao: Memorias de Mario Araujo - de Cabaceiras a Campina Grande
Apresentacao: Memorias de Mario Araujo - de Cabaceiras a Campina GrandeMario Araujo Filho
 
El Escondite Perfecto 1
El Escondite Perfecto 1 El Escondite Perfecto 1
El Escondite Perfecto 1 apuromafo
 
Cordel ministro luiz alberto gurgel de faria 2014 (4)
Cordel ministro luiz alberto gurgel de faria 2014 (4)Cordel ministro luiz alberto gurgel de faria 2014 (4)
Cordel ministro luiz alberto gurgel de faria 2014 (4)Mario Araujo Filho
 

En vedette (6)

Te Que Prohibido Lo Siguiente
Te Que Prohibido Lo SiguienteTe Que Prohibido Lo Siguiente
Te Que Prohibido Lo Siguiente
 
Biblioteca
BibliotecaBiblioteca
Biblioteca
 
Apresentacao: Memorias de Mario Araujo - de Cabaceiras a Campina Grande
Apresentacao: Memorias de Mario Araujo - de Cabaceiras a Campina GrandeApresentacao: Memorias de Mario Araujo - de Cabaceiras a Campina Grande
Apresentacao: Memorias de Mario Araujo - de Cabaceiras a Campina Grande
 
El Escondite Perfecto 1
El Escondite Perfecto 1 El Escondite Perfecto 1
El Escondite Perfecto 1
 
El Toro
El ToroEl Toro
El Toro
 
Cordel ministro luiz alberto gurgel de faria 2014 (4)
Cordel ministro luiz alberto gurgel de faria 2014 (4)Cordel ministro luiz alberto gurgel de faria 2014 (4)
Cordel ministro luiz alberto gurgel de faria 2014 (4)
 

Similaire à Rails User model associations and configuration

RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2Rory Gianni
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanGigin Krishnan
 
Some ways to DRY in Rails
Some ways to DRY in Rails Some ways to DRY in Rails
Some ways to DRY in Rails Framgia Vietnam
 
Ruby on Rails: Coding Guideline
Ruby on Rails: Coding GuidelineRuby on Rails: Coding Guideline
Ruby on Rails: Coding GuidelineNascenia IT
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Henry S
 
Introduction à Ruby
Introduction à RubyIntroduction à Ruby
Introduction à RubyMicrosoft
 
Apache Rewrite Rules
Apache Rewrite RulesApache Rewrite Rules
Apache Rewrite RulesAkhil Bansal
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish MinutesDan Wahlin
 
Trailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererTrailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererPivorak MeetUp
 
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009Yasuko Ohba
 
深入淺出 MVC
深入淺出 MVC深入淺出 MVC
深入淺出 MVCJace Ju
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial之宇 趙
 
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...murtazahaveliwala
 

Similaire à Rails User model associations and configuration (20)

Rails introduction
Rails introductionRails introduction
Rails introduction
 
Rails course day 4
Rails course day 4Rails course day 4
Rails course day 4
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
 
Simple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnanSimple mvc4 prepared by gigin krishnan
Simple mvc4 prepared by gigin krishnan
 
Some ways to DRY in Rails
Some ways to DRY in Rails Some ways to DRY in Rails
Some ways to DRY in Rails
 
Ruby on Rails: Coding Guideline
Ruby on Rails: Coding GuidelineRuby on Rails: Coding Guideline
Ruby on Rails: Coding Guideline
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3
 
Mini Rails Framework
Mini Rails FrameworkMini Rails Framework
Mini Rails Framework
 
Introduction à Ruby
Introduction à RubyIntroduction à Ruby
Introduction à Ruby
 
Apache Rewrite Rules
Apache Rewrite RulesApache Rewrite Rules
Apache Rewrite Rules
 
AngularJS in 60ish Minutes
AngularJS in 60ish MinutesAngularJS in 60ish Minutes
AngularJS in 60ish Minutes
 
Django
DjangoDjango
Django
 
Trailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick SuttererTrailblazer Introduction by Nick Sutterer
Trailblazer Introduction by Nick Sutterer
 
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009
Pragmatic Patterns of Ruby on Rails - Ruby Kaigi2009
 
Curso rails
Curso railsCurso rails
Curso rails
 
深入淺出 MVC
深入淺出 MVC深入淺出 MVC
深入淺出 MVC
 
Presentation
PresentationPresentation
Presentation
 
The Rails Way
The Rails WayThe Rails Way
The Rails Way
 
Django Introduction & Tutorial
Django Introduction & TutorialDjango Introduction & Tutorial
Django Introduction & Tutorial
 
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
Angular training - Day 3 - custom directives, $http, $resource, setup with ye...
 

Plus de Yuichiro MASUI

マッシュアップ沖縄版 おまけ:OpenSocail
マッシュアップ沖縄版 おまけ:OpenSocailマッシュアップ沖縄版 おまけ:OpenSocail
マッシュアップ沖縄版 おまけ:OpenSocailYuichiro MASUI
 
OSC2007-niigata - mashup
OSC2007-niigata - mashupOSC2007-niigata - mashup
OSC2007-niigata - mashupYuichiro MASUI
 
2007/09/29 PHP to Ruby - Webキャリアさん主催 ”PHPプログラマの為のRuby on Rails入門”
2007/09/29 PHP to Ruby - Webキャリアさん主催 ”PHPプログラマの為のRuby on Rails入門”2007/09/29 PHP to Ruby - Webキャリアさん主催 ”PHPプログラマの為のRuby on Rails入門”
2007/09/29 PHP to Ruby - Webキャリアさん主催 ”PHPプログラマの為のRuby on Rails入門”Yuichiro MASUI
 
1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)Yuichiro MASUI
 
Masuidrive Working Style
Masuidrive Working StyleMasuidrive Working Style
Masuidrive Working StyleYuichiro MASUI
 
How to build 1 hour mashup site
How to build 1 hour mashup site How to build 1 hour mashup site
How to build 1 hour mashup site Yuichiro MASUI
 

Plus de Yuichiro MASUI (12)

AIR+Blaze+Ruby
AIR+Blaze+RubyAIR+Blaze+Ruby
AIR+Blaze+Ruby
 
マッシュアップ沖縄版 おまけ:OpenSocail
マッシュアップ沖縄版 おまけ:OpenSocailマッシュアップ沖縄版 おまけ:OpenSocail
マッシュアップ沖縄版 おまけ:OpenSocail
 
OSC2007-niigata - mashup
OSC2007-niigata - mashupOSC2007-niigata - mashup
OSC2007-niigata - mashup
 
2007/09/29 PHP to Ruby - Webキャリアさん主催 ”PHPプログラマの為のRuby on Rails入門”
2007/09/29 PHP to Ruby - Webキャリアさん主催 ”PHPプログラマの為のRuby on Rails入門”2007/09/29 PHP to Ruby - Webキャリアさん主催 ”PHPプログラマの為のRuby on Rails入門”
2007/09/29 PHP to Ruby - Webキャリアさん主催 ”PHPプログラマの為のRuby on Rails入門”
 
InstantRails how to
InstantRails how toInstantRails how to
InstantRails how to
 
Rubyの基礎
Rubyの基礎Rubyの基礎
Rubyの基礎
 
PukiWiki
PukiWikiPukiWiki
PukiWiki
 
1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)1時間で作るマッシュアップサービス(関西版)
1時間で作るマッシュアップサービス(関西版)
 
Masuidrive Working Style
Masuidrive Working StyleMasuidrive Working Style
Masuidrive Working Style
 
Ruby de Rails
Ruby de RailsRuby de Rails
Ruby de Rails
 
How to build 1 hour mashup site
How to build 1 hour mashup site How to build 1 hour mashup site
How to build 1 hour mashup site
 
Furo Grammer
Furo GrammerFuro Grammer
Furo Grammer
 

Rails User model associations and configuration

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46. class User < ActiveRecord::Base end
  • 47.
  • 48.
  • 49. class User < ActiveRecord::Base has_many :books end
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57. class User < ActiveRecord::Base set_table_name 'user' set_primary_key 'pkey' end
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63. ITPro
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94. View Controller Model Rails mongrel
  • 95. View Controller Model
  • 96. View Controller Model URL params[]
  • 97. View Controller URL Model URL params[]
  • 98. View Controller Model.find,model.save URL Model URL params[]
  • 99. View Controller Model.find,model.save URL Model URL params[]
  • 100. View Controller Model.find,model.save URL Model URL params[]
  • 101.
  • 102.
  • 103.