SlideShare une entreprise Scribd logo
1  sur  20
Me Breccan McLeod-Lundy Developer at 3months Recent projects include: consumer.org.nz, digitalnz.org and sponsafier.com
Ruby(is not rails) Variables i = 3 i * 4 etc
Iterating and blocks i = [1,2] i.each do |one_i| Something End i.each do { |i| something }
Classes class  Hello def hi puts “hello” end end
Classes(cont) hello_object = Hello.new hello.hi # hello
If blocks if something stuff elsif something_else Other stuffe else Other other stuff end
Ranges and symbols (1...80) is a range contains everything within it and can be iterated over. Colons start symbols which are minimal bits of data representing only themselves, often used as keys in hashes. :symbol
Rails Started 2004 Included in Mac OS X by default in 2006 Recently: twitter, ravelry etc.
Opinionated Sensible Defaults Don't Repeat Yourself
 
Generators rails appname script/generate model/controller name script/generate migration migration
Scaffold generation Not really my first choice, but good for demonstrations and prototyping. script/generate scaffold Movie name:string description:text
Migrations Go up and down add_column :table, :name, type remove_column :table, :name
Routes Create restful routes for a controller map.resources :controller_name Make default page the index map.root :controller => 'movies', :action => 'index (may also need to delete index.html in public)
Adding Reviews script/generate scaffold Review rating:integer movie_id:integer content:text In movie model add has_many :reviews In review model add belongs_to :movie
Reviews New method in the controller needs an array of movies to be added to: @movies = Movies.all.collect { |movie| [movie.name, movie.id]} The view needs a select: <%= f.select(:movie, @movies) %>
Partials Major part of reusing code. In a view: <% render :partial => “/reviews/form” %> Create partials with file names like _form.html.erb
Displaying reviews on a film In show method of the movie controller add: @reviews = @movie.reviews  (After setting @movie) In the view <% @reviews.each do |review| %> <%= render :partial => “review”, :locals => { :review => review } %> <% end %> Create the partial or even extract it from the default review show!
Other resources Rails Guides Agile web dev with rails book Railscasts Wellrailed google group Google
Breccan McLeod-Lundy www.breccan.com [email_address] breccan on twitter, github etc

Contenu connexe

Tendances

Python Programming for ArcGIS: Part II
Python Programming for ArcGIS: Part IIPython Programming for ArcGIS: Part II
Python Programming for ArcGIS: Part IIDUSPviz
 
Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyUna Daly
 
C program to write c program without using main function
C program to write c program without using main functionC program to write c program without using main function
C program to write c program without using main functionRumman Ansari
 
8.3 program structure (1 hour)
8.3 program structure (1 hour)8.3 program structure (1 hour)
8.3 program structure (1 hour)akmalfahmi
 

Tendances (7)

JavaScript Functions
JavaScript FunctionsJavaScript Functions
JavaScript Functions
 
Python Programming for ArcGIS: Part II
Python Programming for ArcGIS: Part IIPython Programming for ArcGIS: Part II
Python Programming for ArcGIS: Part II
 
Code camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una DalyCode camp 2011 Getting Started with IOS, Una Daly
Code camp 2011 Getting Started with IOS, Una Daly
 
Builder pattern
Builder patternBuilder pattern
Builder pattern
 
C program to write c program without using main function
C program to write c program without using main functionC program to write c program without using main function
C program to write c program without using main function
 
Client sidescripting javascript
Client sidescripting javascriptClient sidescripting javascript
Client sidescripting javascript
 
8.3 program structure (1 hour)
8.3 program structure (1 hour)8.3 program structure (1 hour)
8.3 program structure (1 hour)
 

En vedette

Leonardo Da Vinci
Leonardo Da VinciLeonardo Da Vinci
Leonardo Da VinciM.F.R
 
El alquimista 10 c (2)
El alquimista 10 c (2)El alquimista 10 c (2)
El alquimista 10 c (2)Juanmaloko
 
Sistema monitorización ofertix
Sistema monitorización ofertixSistema monitorización ofertix
Sistema monitorización ofertixJoan Valduvieco
 
Introducción al desarrollo Android, Sesión 2
Introducción al desarrollo Android, Sesión 2Introducción al desarrollo Android, Sesión 2
Introducción al desarrollo Android, Sesión 2findemor
 
オープン・ソシオ提供コンテンツ説明
オープン・ソシオ提供コンテンツ説明オープン・ソシオ提供コンテンツ説明
オープン・ソシオ提供コンテンツ説明Akira Yamaguchi
 

En vedette (10)

Sena delgado
Sena   delgadoSena   delgado
Sena delgado
 
Brik charm
Brik charmBrik charm
Brik charm
 
Android
AndroidAndroid
Android
 
Leonardo Da Vinci
Leonardo Da VinciLeonardo Da Vinci
Leonardo Da Vinci
 
20120725 SukuSuku Scrum
20120725 SukuSuku Scrum20120725 SukuSuku Scrum
20120725 SukuSuku Scrum
 
El alquimista 10 c (2)
El alquimista 10 c (2)El alquimista 10 c (2)
El alquimista 10 c (2)
 
Ficha tecnica
Ficha tecnicaFicha tecnica
Ficha tecnica
 
Sistema monitorización ofertix
Sistema monitorización ofertixSistema monitorización ofertix
Sistema monitorización ofertix
 
Introducción al desarrollo Android, Sesión 2
Introducción al desarrollo Android, Sesión 2Introducción al desarrollo Android, Sesión 2
Introducción al desarrollo Android, Sesión 2
 
オープン・ソシオ提供コンテンツ説明
オープン・ソシオ提供コンテンツ説明オープン・ソシオ提供コンテンツ説明
オープン・ソシオ提供コンテンツ説明
 

Similaire à Rails VUWIT workshop

RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2Rory Gianni
 
Agile Development With Hobo
Agile Development With HoboAgile Development With Hobo
Agile Development With HoboEvarist Lobo
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Railselpizoch
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practicesmanugoel2003
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorialsunniboy
 
Django tutorial
Django tutorialDjango tutorial
Django tutorialKsd Che
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkRyan Weaver
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Cogapp
 
Template rendering in rails
Template rendering in rails Template rendering in rails
Template rendering in rails Hung Wu Lo
 
Introduction à Ruby
Introduction à RubyIntroduction à Ruby
Introduction à RubyMicrosoft
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to DjangoJoaquim Rocha
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven developmentGil Fink
 
Build Your Own Instagram Filters
Build Your Own Instagram FiltersBuild Your Own Instagram Filters
Build Your Own Instagram FiltersTJ Stalcup
 
Coder Presentation Szeged
Coder Presentation SzegedCoder Presentation Szeged
Coder Presentation SzegedDoug Green
 
Rails Rookies Bootcamp - Blogger
Rails Rookies Bootcamp - BloggerRails Rookies Bootcamp - Blogger
Rails Rookies Bootcamp - BloggerNathanial McConnell
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Ondřej Machulda
 
Joomla Day Austin Part 4
Joomla Day Austin Part 4Joomla Day Austin Part 4
Joomla Day Austin Part 4Kyle Ledbetter
 

Similaire à Rails VUWIT workshop (20)

Ruby On Rails
Ruby On RailsRuby On Rails
Ruby On Rails
 
RoR 101: Session 2
RoR 101: Session 2RoR 101: Session 2
RoR 101: Session 2
 
Agile Development With Hobo
Agile Development With HoboAgile Development With Hobo
Agile Development With Hobo
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 
What Is Hobo ?
What Is Hobo ?What Is Hobo ?
What Is Hobo ?
 
Actionview
ActionviewActionview
Actionview
 
Drupal Best Practices
Drupal Best PracticesDrupal Best Practices
Drupal Best Practices
 
Ruby On Rails Tutorial
Ruby On Rails TutorialRuby On Rails Tutorial
Ruby On Rails Tutorial
 
Django tutorial
Django tutorialDjango tutorial
Django tutorial
 
Hands-on with the Symfony2 Framework
Hands-on with the Symfony2 FrameworkHands-on with the Symfony2 Framework
Hands-on with the Symfony2 Framework
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
 
Template rendering in rails
Template rendering in rails Template rendering in rails
Template rendering in rails
 
Introduction à Ruby
Introduction à RubyIntroduction à Ruby
Introduction à Ruby
 
Introduction to Django
Introduction to DjangoIntroduction to Django
Introduction to Django
 
Web component driven development
Web component driven developmentWeb component driven development
Web component driven development
 
Build Your Own Instagram Filters
Build Your Own Instagram FiltersBuild Your Own Instagram Filters
Build Your Own Instagram Filters
 
Coder Presentation Szeged
Coder Presentation SzegedCoder Presentation Szeged
Coder Presentation Szeged
 
Rails Rookies Bootcamp - Blogger
Rails Rookies Bootcamp - BloggerRails Rookies Bootcamp - Blogger
Rails Rookies Bootcamp - Blogger
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 
Joomla Day Austin Part 4
Joomla Day Austin Part 4Joomla Day Austin Part 4
Joomla Day Austin Part 4
 

Dernier

ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?Mark Billinghurst
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaCzechDreamin
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoTAnalytics
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsUXDXConf
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyJohn Staveley
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...CzechDreamin
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoUXDXConf
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIES VE
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomCzechDreamin
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Julian Hyde
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...CzechDreamin
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfFIDO Alliance
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 

Dernier (20)

ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
The Metaverse: Are We There Yet?
The  Metaverse:    Are   We  There  Yet?The  Metaverse:    Are   We  There  Yet?
The Metaverse: Are We There Yet?
 
Powerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara LaskowskaPowerful Start- the Key to Project Success, Barbara Laskowska
Powerful Start- the Key to Project Success, Barbara Laskowska
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Strategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering TeamsStrategic AI Integration in Engineering Teams
Strategic AI Integration in Engineering Teams
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
SOQL 201 for Admins & Developers: Slice & Dice Your Org’s Data With Aggregate...
 
The UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, OcadoThe UX of Automation by AJ King, Senior UX Researcher, Ocado
The UX of Automation by AJ King, Senior UX Researcher, Ocado
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 

Rails VUWIT workshop

  • 1. Me Breccan McLeod-Lundy Developer at 3months Recent projects include: consumer.org.nz, digitalnz.org and sponsafier.com
  • 2. Ruby(is not rails) Variables i = 3 i * 4 etc
  • 3. Iterating and blocks i = [1,2] i.each do |one_i| Something End i.each do { |i| something }
  • 4. Classes class Hello def hi puts “hello” end end
  • 5. Classes(cont) hello_object = Hello.new hello.hi # hello
  • 6. If blocks if something stuff elsif something_else Other stuffe else Other other stuff end
  • 7. Ranges and symbols (1...80) is a range contains everything within it and can be iterated over. Colons start symbols which are minimal bits of data representing only themselves, often used as keys in hashes. :symbol
  • 8. Rails Started 2004 Included in Mac OS X by default in 2006 Recently: twitter, ravelry etc.
  • 9. Opinionated Sensible Defaults Don't Repeat Yourself
  • 10.  
  • 11. Generators rails appname script/generate model/controller name script/generate migration migration
  • 12. Scaffold generation Not really my first choice, but good for demonstrations and prototyping. script/generate scaffold Movie name:string description:text
  • 13. Migrations Go up and down add_column :table, :name, type remove_column :table, :name
  • 14. Routes Create restful routes for a controller map.resources :controller_name Make default page the index map.root :controller => 'movies', :action => 'index (may also need to delete index.html in public)
  • 15. Adding Reviews script/generate scaffold Review rating:integer movie_id:integer content:text In movie model add has_many :reviews In review model add belongs_to :movie
  • 16. Reviews New method in the controller needs an array of movies to be added to: @movies = Movies.all.collect { |movie| [movie.name, movie.id]} The view needs a select: <%= f.select(:movie, @movies) %>
  • 17. Partials Major part of reusing code. In a view: <% render :partial => “/reviews/form” %> Create partials with file names like _form.html.erb
  • 18. Displaying reviews on a film In show method of the movie controller add: @reviews = @movie.reviews (After setting @movie) In the view <% @reviews.each do |review| %> <%= render :partial => “review”, :locals => { :review => review } %> <% end %> Create the partial or even extract it from the default review show!
  • 19. Other resources Rails Guides Agile web dev with rails book Railscasts Wellrailed google group Google
  • 20. Breccan McLeod-Lundy www.breccan.com [email_address] breccan on twitter, github etc