RAILS by Arturas arturaz lajus http:arturaz'net - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

RAILS by Arturas arturaz lajus http:arturaz'net

Description:

foo, _at_bar. Controllers. filters: before. after. around. caching. MODELS AR::Base. AR. ActiveRecord ... Smulkmenu daug, bet visu nei liesi. Integruotas ... – PowerPoint PPT presentation

Number of Views:68
Avg rating:3.0/5.0
Slides: 28
Provided by: artu1
Category:
Tags: rails | arturas | arturaz | foo | http | lajus | net

less

Transcript and Presenter's Notes

Title: RAILS by Arturas arturaz lajus http:arturaz'net


1
RAILS?by Arturas arturaz lajushttp//arturaz
.net/
2
(No Transcript)
3
(No Transcript)
4
  • RAILS yra
  • MVC DAO
  • OOP
  • DRY
  • KISS
  • frameworkas

5
  • app/
  • controllers/
  • models/
  • views/
  • config/
  • db/

ir kitos direktorijos
6
(No Transcript)
7
AppController-gtYourController
Models
View-gtLayout
8
  • Controllers lt ApplicationController
  • ApplicationController lt ActionControllerBase

9
Controllers
  • params
  • request
  • session
  • flash
  • _at_foo, _at_bar
  • filters
  • before
  • after
  • around.
  • caching

10
MODELS lt ARBase
  • AR
  • ActiveRecord
  • ActiveResource

11
MODELS
  • callbacks
  • validation
  • relationships
  • transactions
  • CRUD

12
has_one
belongs_to
13
has_many
belongs_to
14
HABTM
15
  • VIEWS - .format.builder

Formats html js css rss
Builders erb builder haml markdown
16
VIEWS
  • _at_foo, _at_bar, _at_baz
  • form_for, link_to,
  • render
  • yarr custom helpers!

17
(No Transcript)
18
EXAMPLE
19
  • class IndexController lt ApplicationController
  • def index
  • _at_events Event.find(all,
  • conditions gt "start gt NOW()",
  • order gt "start, title",
  • limit gt 5
  • )
  • end
  • end

20
  • class Event lt ActiveRecordBase
  • end

21
  • lt title "Naujausi ivykiai" gt
  • lt _at_events.each do event gt
  • lt link_to event.title, event_url(event) gt
  • lt end gt

22
(No Transcript)
23
  • Live demo bus gale

24
  • Where did events_url come from?
  • config/routes.rb

25
(No Transcript)
26
  • Pasakot ner ka.
  • Smulkmenu daug, bet visu neiliesi.
  • Integruotas prototype, scriptaculous, unit
    testingas.
  • Pluginu sistema.
  • Tiek.

27
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com