提交 23244306 编写于 作者: D David Heinemeier Hansson

Updated examples to use ApplicationController instead of AbstractApplicationController

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@161 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 17a74d90
*SVN* *SVN*
* Added that controllers will now search for a layout in $template_root/layouts/$controller_name.r(html|xml), so PostsController will look
for layouts/posts.rhtml or layouts/posts.rxml and automatically configure this layout if found #307 [Marcel]
* Added FormHelper#radio_button to work with radio buttons like its already possible with check boxes [Michael Koziarski] * Added FormHelper#radio_button to work with radio buttons like its already possible with check boxes [Michael Koziarski]
* Added TemplateError#backtrace that makes it much easier to debug template errors from unit and functional tests * Added TemplateError#backtrace that makes it much easier to debug template errors from unit and functional tests
...@@ -8,7 +11,7 @@ ...@@ -8,7 +11,7 @@
* Added option to ERB templates to swallow newlines by using <% if something -%> instead of just <% if something %>. Example: * Added option to ERB templates to swallow newlines by using <% if something -%> instead of just <% if something %>. Example:
class SomeController < AbstractApplicationController class SomeController < ApplicationController
<% if options[:scaffold] %> <% if options[:scaffold] %>
scaffold :<%= singular_name %> scaffold :<%= singular_name %>
<% end %> <% end %>
...@@ -16,7 +19,7 @@ ...@@ -16,7 +19,7 @@
...produces this on post as singular_name: ...produces this on post as singular_name:
class SomeController < AbstractApplicationController class SomeController < ApplicationController
scaffold :post scaffold :post
...@@ -24,7 +27,7 @@ ...@@ -24,7 +27,7 @@
...where as: ...where as:
class SomeController < AbstractApplicationController class SomeController < ApplicationController
<% if options[:scaffold] -%> <% if options[:scaffold] -%>
scaffold :<%= singular_name %> scaffold :<%= singular_name %>
<% end -%> <% end -%>
...@@ -32,7 +35,7 @@ ...@@ -32,7 +35,7 @@
...produces: ...produces:
class SomeController < AbstractApplicationController class SomeController < ApplicationController
scaffold :post scaffold :post
helper :post helper :post
...@@ -137,13 +140,13 @@ ...@@ -137,13 +140,13 @@
* Added that controllers will automatically require their own helper if possible. So instead of doing: * Added that controllers will automatically require their own helper if possible. So instead of doing:
class MsgController < AbstractApplicationController class MsgController < ApplicationController
helper :msg helper :msg
end end
...you can just do: ...you can just do:
class MsgController < AbstractApplicationController class MsgController < ApplicationController
end end
* Added dependencies_on(layer) to query the dependencies of a controller. Examples: * Added dependencies_on(layer) to query the dependencies of a controller. Examples:
...@@ -154,7 +157,7 @@ ...@@ -154,7 +157,7 @@
* Added a new dependency model with the class methods model, service, and observer. Example: * Added a new dependency model with the class methods model, service, and observer. Example:
class MsgController < AbstractApplicationController class MsgController < ApplicationController
model :post, :comment, :attachment model :post, :comment, :attachment
service :notification_service service :notification_service
observer :comment_observer observer :comment_observer
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册