D
David Heinemeier Hansson
What's new in Rails 0.5.5?
==========================
Rails now works out of the box on Windows (no more symlinks), has an
awesome WEBrick-based internal web server (Apache is still supported,
of course), includes a ton of fixes for stuff that stumped people with
0.5.0, and includes Action Pack 0.7.6 and Active Record 0.9.1. This is
quite an important update. Unless you already got a lot going on 0.5.0,
it’s recommended to switch directly to 0.5.5.
Download from http://www.rubyonrails.org, talk on #rubyonrails
(FreeNet).
Changes for Rails
=================
* Works on Windows out of the box! (Dropped symlinks)
* Added webrick dispatcher: Try "ruby public/dispatch.servlet --help"
[Florian Gross]
* Report errors about initialization to browser (instead of attempting
to use uninitialized logger)
* Upgraded to Action Pack 0.7.6
* Upgraded to Active Record 0.9.1
* Added distinct 500.html instead of reusing 404.html
* Changed license to MIT License (and included license file in package)
Changes for Action Pack
=======================
* Included ERB::Util so all templates can easily escape HTML content
with <%=h @person.content %>
* All requests are now considered local by default, so everyone
will be exposed to detailed debugging screens on errors.
When the application is ready to go public, set
ActionController::Base.consider_all_requests_local to false,
and implement the protected method local_request? in the controller
to determine when debugging screens should be shown.
* Fixed three bugs with the url_for/redirect_to/link_to handling.
Considering the url http://localhost:81/friends/show/1
url_foraction => "list")
...used to give http://localhost:81/friends/list/1
......now gives http://localhost:81/friends/list
url_forcontroller => "friends", :action => "destroy", :id => 5)
...used to give http://localhost:81/friends/destroy
......now gives http://localhost:81/friends/destroy/5
Considering the url http://localhost:81/teachers/show/t
url_foraction => "list", :id => 5)
...used to give http://localhost:81/5eachers/list/t
......now gives http://localhost:81/teachers/list/5
[Reported by David Morton & Radsaq]
* Logs exception to logfile in addition to showing them for local
requests
* Protects the eruby load behind a begin/rescue block. eRuby is not
required to run ActionController.
* Fixed install.rb to also install clean_logger and the templates
* Added ActiveRecordStore as a session option. Read more in
lib/action_controller/session/active_record_store.rb [Tim Bates]
* Changed license to MIT License (and included license file in package)
* Application error page now returns status code 500 instead of 200
* Fixed using Procs as layout handlers [Florian Weber]
* Fixed bug with using redirects ports other than 80
* Added index method that calls list on scaffolding
Changes for Active Record
=========================
* Changed license to MIT License (and included license file in package)
* Added natural object-style assignment for has_and_belongs_to_many
associations.
Consider the following model:
class Event < ActiveRecord::Base
has_one_and_belongs_to_many :sponsors
end
class Sponsor < ActiveRecord::Base
has_one_and_belongs_to_many :sponsors
end
Earlier, you'd have to use synthetic methods for creating
associations between two objects of the above class:
roskilde_festival.add_to_sponsors(carlsberg)
roskilde_festival.remove_from_sponsors(carlsberg)
nike.add_to_events(world_cup)
nike.remove_from_events(world_cup)
Now you can use regular array-styled methods:
roskilde_festival.sponsors << carlsberg
roskilde_festival.sponsors.delete(carlsberg)
nike.events << world_cup
nike.events.delete(world_cup)
* Added delete method for has_many associations. Using this will
nullify an association between the has_many and the belonging
object by setting the foreign key to null. Consider this model:
class Post < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
belongs_to ost
end
You could do something like:
funny_comment.has_post? # => true
announcement.comments.delete(funny_comment)
funny_comment.has_post? # => false
What is Rails?
==============
Rails is a open source web-application framework for Ruby. It ships
with an answer for every letter in MVC: Action Pack for the Controller
and View, Active Record for the Model.
Everything needed to build real-world applications in less lines of
code than other frameworks spend setting up their XML configuraion
files. Like Basecamp, which was launched after 4 KLOCs and two months
of developement by a single programmer.
Being a full-stack framework means that all layers are built to work
seemlessly together. That way you Don’t Repeat Yourself (DRY) and you
can use a single language from top to bottom. Everything from templates
to control flow to business logic is written in Ruby—the language of
love for industry heavy-weights
In striving for DRY compliance, Rails shuns configuration files and
annotations in favor of reflection and run-time extensions. This means
the end of XML files telling a story that has already been told in
code. It means no compilation phase: Make a change, see it work.
Meta-data is an implementation detail left for the framework to handle.
What is Active Record?
======================
Active Record connects business objects and database tables to create a
persistable domain model where logic and data is presented in one
wrapping. It’s an implementation of the object-relational mapping (ORM)
pattern by the same name as described by Martin Fowler:
An object that wraps a row in a database table or view,
encapsulates the database access, and adds domain logic on that
data.
Active Record’s main contribution to the pattern is to relieve the
original of two stunting problems: lack of associations and
inheritance. By adding a simple domain language-like set of macros to
describe the former and integrating the Single Table Inheritance
pattern for the latter, Active Record narrows the gap of functionality
between the data-mapper and active record approach.
Learn more: http://activerecord.rubyonrails.org
What is Action Pack?
====================
Action Pack splits the response to a web request into a controller part
(performing the logic) and a view part (rendering a template). This
two-step approach is known as an action, which will normally create,
read, update, or delete (CRUD for short) some sort of model part (often
database) before choosing either to render a template or redirecting to
another action.
Action Pack implements these actions as public methods on Action
Controllers and uses Action Views to implement the template rendering.
Action Controllers are then responsible for handling all the actions
relating to a certain part of an application. This grouping usually
consists of actions for lists and for CRUDs revolving around a single
(or a few) model objects. So ContactController would be responsible for
listing contacts, creating, deleting, and update contacts. A
WeblogController could be responsible for both posts and comments.
Action View templates are written using embedded Ruby in tags mingled
in with the HTML. To avoid cluttering the templates with code, a bunch
of helper classes provide common behavior for forms, dates, and
strings. And it’s easy to add specific helpers to keep the separation
as the application extends.
Learn more: http://actionpack.rubyonrails.org
--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services
==========================
Rails now works out of the box on Windows (no more symlinks), has an
awesome WEBrick-based internal web server (Apache is still supported,
of course), includes a ton of fixes for stuff that stumped people with
0.5.0, and includes Action Pack 0.7.6 and Active Record 0.9.1. This is
quite an important update. Unless you already got a lot going on 0.5.0,
it’s recommended to switch directly to 0.5.5.
Download from http://www.rubyonrails.org, talk on #rubyonrails
(FreeNet).
Changes for Rails
=================
* Works on Windows out of the box! (Dropped symlinks)
* Added webrick dispatcher: Try "ruby public/dispatch.servlet --help"
[Florian Gross]
* Report errors about initialization to browser (instead of attempting
to use uninitialized logger)
* Upgraded to Action Pack 0.7.6
* Upgraded to Active Record 0.9.1
* Added distinct 500.html instead of reusing 404.html
* Changed license to MIT License (and included license file in package)
Changes for Action Pack
=======================
* Included ERB::Util so all templates can easily escape HTML content
with <%=h @person.content %>
* All requests are now considered local by default, so everyone
will be exposed to detailed debugging screens on errors.
When the application is ready to go public, set
ActionController::Base.consider_all_requests_local to false,
and implement the protected method local_request? in the controller
to determine when debugging screens should be shown.
* Fixed three bugs with the url_for/redirect_to/link_to handling.
Considering the url http://localhost:81/friends/show/1
url_foraction => "list")
...used to give http://localhost:81/friends/list/1
......now gives http://localhost:81/friends/list
url_forcontroller => "friends", :action => "destroy", :id => 5)
...used to give http://localhost:81/friends/destroy
......now gives http://localhost:81/friends/destroy/5
Considering the url http://localhost:81/teachers/show/t
url_foraction => "list", :id => 5)
...used to give http://localhost:81/5eachers/list/t
......now gives http://localhost:81/teachers/list/5
[Reported by David Morton & Radsaq]
* Logs exception to logfile in addition to showing them for local
requests
* Protects the eruby load behind a begin/rescue block. eRuby is not
required to run ActionController.
* Fixed install.rb to also install clean_logger and the templates
* Added ActiveRecordStore as a session option. Read more in
lib/action_controller/session/active_record_store.rb [Tim Bates]
* Changed license to MIT License (and included license file in package)
* Application error page now returns status code 500 instead of 200
* Fixed using Procs as layout handlers [Florian Weber]
* Fixed bug with using redirects ports other than 80
* Added index method that calls list on scaffolding
Changes for Active Record
=========================
* Changed license to MIT License (and included license file in package)
* Added natural object-style assignment for has_and_belongs_to_many
associations.
Consider the following model:
class Event < ActiveRecord::Base
has_one_and_belongs_to_many :sponsors
end
class Sponsor < ActiveRecord::Base
has_one_and_belongs_to_many :sponsors
end
Earlier, you'd have to use synthetic methods for creating
associations between two objects of the above class:
roskilde_festival.add_to_sponsors(carlsberg)
roskilde_festival.remove_from_sponsors(carlsberg)
nike.add_to_events(world_cup)
nike.remove_from_events(world_cup)
Now you can use regular array-styled methods:
roskilde_festival.sponsors << carlsberg
roskilde_festival.sponsors.delete(carlsberg)
nike.events << world_cup
nike.events.delete(world_cup)
* Added delete method for has_many associations. Using this will
nullify an association between the has_many and the belonging
object by setting the foreign key to null. Consider this model:
class Post < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
belongs_to ost
end
You could do something like:
funny_comment.has_post? # => true
announcement.comments.delete(funny_comment)
funny_comment.has_post? # => false
What is Rails?
==============
Rails is a open source web-application framework for Ruby. It ships
with an answer for every letter in MVC: Action Pack for the Controller
and View, Active Record for the Model.
Everything needed to build real-world applications in less lines of
code than other frameworks spend setting up their XML configuraion
files. Like Basecamp, which was launched after 4 KLOCs and two months
of developement by a single programmer.
Being a full-stack framework means that all layers are built to work
seemlessly together. That way you Don’t Repeat Yourself (DRY) and you
can use a single language from top to bottom. Everything from templates
to control flow to business logic is written in Ruby—the language of
love for industry heavy-weights
In striving for DRY compliance, Rails shuns configuration files and
annotations in favor of reflection and run-time extensions. This means
the end of XML files telling a story that has already been told in
code. It means no compilation phase: Make a change, see it work.
Meta-data is an implementation detail left for the framework to handle.
What is Active Record?
======================
Active Record connects business objects and database tables to create a
persistable domain model where logic and data is presented in one
wrapping. It’s an implementation of the object-relational mapping (ORM)
pattern by the same name as described by Martin Fowler:
An object that wraps a row in a database table or view,
encapsulates the database access, and adds domain logic on that
data.
Active Record’s main contribution to the pattern is to relieve the
original of two stunting problems: lack of associations and
inheritance. By adding a simple domain language-like set of macros to
describe the former and integrating the Single Table Inheritance
pattern for the latter, Active Record narrows the gap of functionality
between the data-mapper and active record approach.
Learn more: http://activerecord.rubyonrails.org
What is Action Pack?
====================
Action Pack splits the response to a web request into a controller part
(performing the logic) and a view part (rendering a template). This
two-step approach is known as an action, which will normally create,
read, update, or delete (CRUD for short) some sort of model part (often
database) before choosing either to render a template or redirecting to
another action.
Action Pack implements these actions as public methods on Action
Controllers and uses Action Views to implement the template rendering.
Action Controllers are then responsible for handling all the actions
relating to a certain part of an application. This grouping usually
consists of actions for lists and for CRUDs revolving around a single
(or a few) model objects. So ContactController would be responsible for
listing contacts, creating, deleting, and update contacts. A
WeblogController could be responsible for both posts and comments.
Action View templates are written using embedded Ruby in tags mingled
in with the HTML. To avoid cluttering the templates with code, a bunch
of helper classes provide common behavior for forms, dates, and
strings. And it’s easy to add specific helpers to keep the separation
as the application extends.
Learn more: http://actionpack.rubyonrails.org
--
David Heinemeier Hansson,
http://www.rubyonrails.org/ -- Web-application framework for Ruby
http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby
http://www.basecamphq.com/ -- Web-based Project Management
http://www.loudthinking.com/ -- Broadcasting Brain
http://www.nextangle.com/ -- Development & Consulting Services