Ruby on Rails/第11回勉強会 - RESTful Rails Development http://www.ark-web.jp/sandbox/wiki/207.html

Ruby on Rails/第11回勉強会 - RESTful Rails Development

Ruby on Rails/第11回勉強会 - RESTful Rails Development

[edit]

Ruby on Rails勉強会一覧

[edit]

第11回勉強会のネタ

ネタもとは下記です。

b-simple.de - Ruby on Rails, Entwicklung, Coaching und mehr!
http://www.b-simple.de/documents

[edit]

日時

[edit]

参加者

[edit]

動画

[edit]

RESTful Rails

[edit]

RESTとはなにか?

[edit]

なぜREST?

[edit]

What's New

あなたは一度RESTを理解し、その技術を利用すれば、RESTfulアプリケーションの設計は次の標準となるだろう。

[edit]

Preparations

[edit]

Rails 1.2

[edit]

Resource Scaffolding

ruby script/generate scaffold_resource project name:string desc:text
exists app/controllers/
exists app/helpers/
create app/views/projects
exists test/functional/
exists test/unit/
create app/views/projects/index.rhtml
create app/views/projects/show.rhtml
create app/views/projects/new.rhtml
create app/views/projects/edit.rhtml
create app/views/layouts/projects.rhtml
create public/stylesheets/scaffold.
create app/models/project.rb
create app/controllers/projects_controller.
create test/functional/projects_controller_
create app/helpers/projects_helper.
create test/unit/project_test.rb
create test/fixtures/projects.yml
create db/migrate
create db/migrate/001_create_projects.
route map.resources :projects
[edit]

The Model

[edit]

The Controller

[edit]

REST-URLs

[edit]

REST actions are using respond to

[edit]

Accept-Field of the HTTP-Header

[edit]

Format specification via the URL

[edit]

REST-URLs and Views

[edit]

New and Edit

[edit]

Path-Methods in forms: Create and Update

[edit]

The New Form

[edit]

The Edit Form

form_for(:project, :url => project_path(@project),
         :html => { :method => :put }) do |f| ...
=>
<form action="/projects/1" method="post">
<div style="margin:0;padding:0">
<input name="_method" type="hidden" value="put" />
</div>
[edit]

Destroy

link_to "Destroy", project_path(project), :method => :delete
=>
<a href="/projects/1"
onclick="var f = document.createElement(’form’);
f.style.display = ’none’; this.parentNode.appendChild(f);
f.method = ’POST’; f.action = this.href;
var m = document.createElement(’input’);
m.setAttribute(’type’, ’hidden’);
m.setAttribute(’name’, ’_method’);
m.setAttribute(’value’, ’delete’); f.appendChild(m);f.submit();
return false;">Destroy</a>

投稿者志田 | パーマリンク

| append.gif

tag: Ruby on Rails, 勉強会


トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2007-05-30 (水) 16:53:10 (4529d)

アークウェブのサービスやソリューションはこちら