let s get on rails
play

Lets Get on Rails Venkat Subramaniam svenkat@cs.uh.edu 1 Whats - PDF document

Lets Get on Rails Venkat Subramaniam svenkat@cs.uh.edu 1 Whats Rails? Web Development Frameworks Build on Ruby (so called Ruby on Rails) Agile Lightweight Heavily relies on Convention over configuration Venkat


  1. Let’s Get on Rails Venkat Subramaniam – svenkat@cs.uh.edu 1 What’s Rails? • Web Development Frameworks • Build on Ruby (so called Ruby on Rails) • Agile • Lightweight • Heavily relies on Convention over configuration Venkat Subramaniam – svenkat@cs.uh.edu 2

  2. Built On Some Key Principles • Rails follows some good principles – MVC – DRY – Convention over configuration – “Unit Testing” – actually more than unit testing, though they call it that – Created bottom up – from real project, not designed by a committee Venkat Subramaniam – svenkat@cs.uh.edu 3 Convention Over Configuration • No heavy XML based configuration • As long as you follow convention, you need to do less work – A bit of a problem for newbies – You love it once you get used to it • You name files in a certain way, put them in specific places, … • You can deviate from conventions if you like, but the configuration is also using ruby, so fairly easy Venkat Subramaniam – svenkat@cs.uh.edu 4

  3. Rails and MVC • Rails follows MVC • It actually does not simply promote MVC, it follows you home, sits with you, and makes sure you follow it • Controller receives request • You access model to manipulate data • It transfers control to a view for display R O Controller U T I N Model Browser G Business rules + data View Venkat Subramaniam – svenkat@cs.uh.edu 5 MVC in Rails • Convention over configuration – URL maps to an action on controller • Controller performs logic • Rails copies fields of controller to view • View generates response to be rendered • View: Action View • Controller: Action Controller • Model: Active Records Venkat Subramaniam – svenkat@cs.uh.edu 6

  4. Let’s Build and Learn • We will build an application and learn about Rails, conventions, etc. using that example as a vehicle Venkat Subramaniam – svenkat@cs.uh.edu 7

Recommend


More recommend