1. Trang chủ
  2. » Công Nghệ Thông Tin

oreilly ajax on rails (2006)

426 345 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 426
Dung lượng 4,13 MB

Nội dung

[...]... the company embarked on its next Ajax/ Rails application, Backpack (http://backpackit.com), Ajax functionality had been added to the framework The result was that Rails was one of the first web frameworks with first-class Ajax support And because of the philosophy of extraction, it remains one of the most pragmatically useful environments to work in There are two sides to the Ajax/ Rails coin The first... mechanisms, motivation, and location in the larger historical context of the Web We deconstructed the strict acronym interpretation of Ajax and replaced it with a definition centered more on solving problems Then we shifted attention to Rails, Ruby, and frameworks in general We discussed the ideals that guide the development of Rails and the history of Ajax in Rails In the last section, we fired up the terminal... system's command line: rails ajaxonrails cd ajaxonrails script/server Browse to http://localhost:3000, and you should see Rails' welcome screen (for development purposes, script/server starts an HTTP server on port 3000) Back at the command line, let's generate a new controller called Chapter2Controller with an action called myaction (Since you're already running the server in one terminal window, you'll... acknowledges its opinions or strongly defines its vision In fact, many pieces of software go out of their way to appear neutral on matters of style and practice Rails takes the opposite approachit has a strong vision and makes its opinions about web development very clear Take the example above, for instance Rails promotes the opinion that models generally ought to correspond one-to-one with database tables... should see the Rails welcome screen ( Figure 1-5 ) Congratulations, you're on Rails! Figure 1-5 Ruby on Rails: Welcome aboard 1.5.5 Rails Writ Large Now that you've had a little taste of the practice, here's the theory This section is just overviewfor the full details on these things, refer to the Rails resources above Rails is divided into a handful of libraries: ActiveRecord and ActionPack (the most... application (perhaps your home directory or your work area) Then, run rails ajaxonrails The rails command-line program simply generates a skeleton appall the standard directories and boilerplate files you'll need for every project Take a look in the ajaxonrails directory that you just created, and you'll see the following: app/ As the name suggests, this is where your Rails- specific application code... callbacks, and validation rules in the ActiveRecord class definition, you're making it easier to create reliable, maintainable code ActionPack has two subparts that work together closely, ActionController and ActionView ActionController classes define actionspublic methods that are accessible from the Web Actions always end in one of two ways: either with a redirect (an HTTP response header sent back,... be started on port 8808 Then browse to http://localhost:8808 and you'll see a list of every package installed via RubyGems The #rubyonrails IRC channel is great resource for interacting with other Rails developers As with #ruby-lang, just use any IRC client and connect to irc.freenode.net The Rails Wiki (http://wiki.rubyonrails.org /rails) is full of user-contributed hints and tutorials on everything... necessarily imply that Ajax always results in a change to the UI For example, some applications use Ajax to notify the server about the user's interactions with the page, but don't do anything with the server's response These fundamental differences from the traditional request cycle are what enable Ajax applications to be significantly more responsive And that means that web applications can start to perform... functions from the rest of your application views/ We'll be spending a lot of time in this directoryit's where your view layer lives, which is responsible for generating HTML, among other things config/ Here you'll configure your application for its environment, telling it how to connect to a database, how external URLs map to internal code, etc doc/ Rails can automatically generate API documentation . what's happening under the hood. Ajax on Rails includes three fully worked out Rails /Ajax applications, and quick reference sections for Prototype and script.aculo.us. Testing lessons show you how to eliminate. what's happening under the hood. Ajax on Rails includes three fully worked out Rails /Ajax applications, and quick reference sections for Prototype and script.aculo.us. Testing lessons show you how to eliminate. Table of Contents | Index Copyright Preface Chapter 1. Introduction Section 1.1. Who This Book Is For Section 1.2. What Ajax Is Section 1.3. What Rails Is Section 1.4. 'You

Ngày đăng: 27/03/2014, 13:36