From b95aa05314e837bd25b6d1bcb9017c297cbea7f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hrvoje=20=C5=A0imi=C4=87?= Date: Mon, 2 Apr 2012 18:31:20 +0200 Subject: update to current rack middleware stack --- guides/source/rails_on_rack.textile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'guides/source') diff --git a/guides/source/rails_on_rack.textile b/guides/source/rails_on_rack.textile index 9526526bc7..f2cf224987 100644 --- a/guides/source/rails_on_rack.textile +++ b/guides/source/rails_on_rack.textile @@ -91,13 +91,15 @@ For a freshly generated Rails application, this might produce something like: use ActionDispatch::Static use Rack::Lock -use ActiveSupport::Cache::Strategy::LocalCache +use # use Rack::Runtime +use Rack::MethodOverride +use ActionDispatch::RequestId use Rails::Rack::Logger use ActionDispatch::ShowExceptions use ActionDispatch::DebugExceptions use ActionDispatch::RemoteIp -use Rack::Sendfile +use ActionDispatch::Reloader use ActionDispatch::Callbacks use ActiveRecord::ConnectionAdapters::ConnectionManagement use ActiveRecord::QueryCache @@ -105,8 +107,9 @@ use ActionDispatch::Cookies use ActionDispatch::Session::CookieStore use ActionDispatch::Flash use ActionDispatch::ParamsParser -use Rack::MethodOverride use ActionDispatch::Head +use Rack::ConditionalGet +use Rack::ETag use ActionDispatch::BestStandardsSupport run Blog::Application.routes -- cgit v1.2.3 From e94437e3c66ce69b0ad7ca8c86d00d0ff5137896 Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Tue, 3 Apr 2012 01:11:44 +0800 Subject: wrong link to getting started guide --- guides/source/engines.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/engines.textile b/guides/source/engines.textile index 20df254950..3b0ab9f6d9 100644 --- a/guides/source/engines.textile +++ b/guides/source/engines.textile @@ -126,7 +126,7 @@ Also in the test directory is the +test/integration+ directory, where integratio h3. Providing engine functionality -The engine that this guide covers will provide posting and commenting functionality and follows a similar thread to the "Getting Started Guide":getting-started.html, with some new twists. +The engine that this guide covers will provide posting and commenting functionality and follows a similar thread to the "Getting Started Guide":getting_started.html, with some new twists. h4. Generating a post resource -- cgit v1.2.3 From 4b1ed1d29f9d42f6d52562778f35c3b0e2888b72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hrvoje=20=C5=A0imi=C4=87?= Date: Mon, 2 Apr 2012 20:31:38 +0200 Subject: update purpose of middleware --- guides/source/rails_on_rack.textile | 77 +++++++++++++++++++++++++++++++------ 1 file changed, 66 insertions(+), 11 deletions(-) (limited to 'guides/source') diff --git a/guides/source/rails_on_rack.textile b/guides/source/rails_on_rack.textile index f2cf224987..73e0f242cc 100644 --- a/guides/source/rails_on_rack.textile +++ b/guides/source/rails_on_rack.textile @@ -164,18 +164,73 @@ config.middleware.delete(middleware) h4. Internal Middleware Stack -Much of Action Controller's functionality is implemented as Middlewares. The following table explains the purpose of each of them: +Much of Action Controller's functionality is implemented as Middlewares. The following list explains the purpose of each of them: -|_.Middleware|_.Purpose| -|+Rack::Lock+|Sets env["rack.multithread"] flag to +true+ and wraps the application within a Mutex.| -|+ActionController::Failsafe+|Returns HTTP Status +500+ to the client if an exception gets raised while dispatching.| -|+ActiveRecord::QueryCache+|Enables the Active Record query cache.| -|+ActionDispatch::Session::CookieStore+|Uses the cookie based session store.| -|+ActionDispatch::Session::CacheStore+|Uses the Rails cache based session store.| -|+ActionDispatch::Session::MemCacheStore+|Uses the memcached based session store.| -|+ActiveRecord::SessionStore+|Uses the database based session store.| -|+Rack::MethodOverride+|Sets HTTP method based on +_method+ parameter or env["HTTP_X_HTTP_METHOD_OVERRIDE"].| -|+Rack::Head+|Discards the response body if the client sends a +HEAD+ request.| + *+ActionDispatch::Static+* +* Used to serve static assets. Disabled if config.serve_static_assets is true. + + *+Rack::Lock+* +* Sets env["rack.multithread"] flag to +true+ and wraps the application within a Mutex. + + *+ActiveSupport::Cache::Strategy::LocalCache::Middleware+* +* Used for memory caching. This cache is not thread safe. + + *+Rack::Runtime+* +* Sets an X-Runtime header, containing the time (in seconds) taken to execute the request. + + *+Rack::MethodOverride+* +* Allows the method to be overridden if params[:_method] is set. This is the middleware which supports the PUT and DELETE HTTP method types. + + *+ActionDispatch::RequestId+* +* Makes a unique +X-Request-Id+ header available to the response and enables the ActionDispatch::Request#uuid method. + + *+Rails::Rack::Logger+* +* Notifies the logs that the request has began. After request is complete, flushes all the logs. + + *+ActionDispatch::ShowExceptions+* +* Rescues any exception returned by the application and calls an exceptions app that will wrap it in a format for the end user. + + *+ActionDispatch::DebugExceptions+* +* Responsible for logging exceptions and showing a debugging page in case the request is local. + + *+ActionDispatch::RemoteIp+* +* Checks for IP spoofing attacks. + + *+ActionDispatch::Reloader+* +* Provides prepare and cleanup callbacks, intended to assist with code reloading during development. + + *+ActionDispatch::Callbacks+* +* Runs the prepare callbacks before serving the request. + + *+ActiveRecord::ConnectionAdapters::ConnectionManagement+* +* Cleans active connections after each request, unless the rack.test key in the request environment is set to +true+. + + *+ActiveRecord::QueryCache+* +* Enables the Active Record query cache. + + *+ActionDispatch::Cookies+* +* Sets cookies for the request. + + *+ActionDispatch::Session::CookieStore+* +* Responsible for storing the session in cookies. + + *+ActionDispatch::Flash+* +* Sets up the flash keys. Only available if config.action_controller.session_store is set to a value. + + *+ActionDispatch::ParamsParser+* +* Parses out parameters from the request into params. + + *+ActionDispatch::Head+* +* Converts HEAD requests to +GET+ requests and serves them as so. + + *+Rack::ConditionalGet+* +* Adds support for "Conditional +GET+" so that server responds with nothing if page wasn't changed. + + *+Rack::ETag+* +* Adds ETag header on all String bodies. ETags are used to validate cache. + + *+ActionDispatch::BestStandardsSupport+* +* Enables “best standards support” so that IE8 renders some elements correctly. TIP: It's possible to use any of the above middlewares in your custom Rack stack. -- cgit v1.2.3 From d586b07f9eb2d266efef61eaab5d2b57ecef149d Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Tue, 3 Apr 2012 22:34:46 +0800 Subject: Changed engines guide not to use a css tag. will do just fine. https://github.com/lifo/docrails/commit/bb23d6fb005edaf25f5b294f9215429fb44b3f3d --- guides/source/engines.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guides/source') diff --git a/guides/source/engines.textile b/guides/source/engines.textile index 3b0ab9f6d9..4ae61fde42 100644 --- a/guides/source/engines.textile +++ b/guides/source/engines.textile @@ -717,11 +717,11 @@ Imagine that you did have an asset located at +app/assets/stylesheets/blorgh/sty You can also specify these assets as dependencies of other assets using the Asset Pipeline require statements in processed files: - + /* *= require blorgh/style */ - + h4. Separate Assets & Precompiling -- cgit v1.2.3 From 1827bc9524aef939615395eb153a9f5f093735cc Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Wed, 4 Apr 2012 00:46:43 +0800 Subject: also replaced by --- guides/source/engines.textile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guides/source') diff --git a/guides/source/engines.textile b/guides/source/engines.textile index 4ae61fde42..25c4faf648 100644 --- a/guides/source/engines.textile +++ b/guides/source/engines.textile @@ -355,11 +355,11 @@ end This is the final part required to get the new comment form working. Displaying the comments however, is not quite right yet. If you were to create a comment right now you would see this error: - + Missing partial blorgh/comments/comment with {:handlers=>[:erb, :builder], :formats=>[:html], :locale=>[:en, :en]}. Searched in: * "/Users/ryan/Sites/side_projects/blorgh/test/dummy/app/views" * "/Users/ryan/Sites/side_projects/blorgh/app/views" - + The engine is unable to find the partial required for rendering the comments. Rails has looked firstly in the application's (+test/dummy+) +app/views+ directory and then in the engine's +app/views+ directory. When it can't find it, it will throw this error. The engine knows to look for +blorgh/comments/comment+ because the model object it is receiving is from the +Blorgh::Comment+ class. @@ -536,9 +536,9 @@ Finally, the author's name should be displayed on the post's page. Add this code By outputting +@post.author+ using the +<%=+ tag the +to_s+ method will be called on the object. By default, this will look quite ugly: - + # - + This is undesirable and it would be much better to have the user's name there. To do this, add a +to_s+ method to the +User+ class within the application: -- cgit v1.2.3 From 428149c8f3bf4d9887318a1346fe2bf3e3367595 Mon Sep 17 00:00:00 2001 From: Fernando Briano Date: Tue, 3 Apr 2012 15:42:18 -0300 Subject: Fixed small typo --- guides/source/migrations.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/migrations.textile b/guides/source/migrations.textile index c11f8e221b..cb7ee1e6a2 100644 --- a/guides/source/migrations.textile +++ b/guides/source/migrations.textile @@ -497,7 +497,7 @@ and h4. Using the +change+ Method The +change+ method removes the need to write both +up+ and +down+ methods in -those cases that Rails know how to revert the changes automatically. Currently, +those cases that Rails knows how to revert the changes automatically. Currently, the +change+ method supports only these migration definitions: * +add_column+ -- cgit v1.2.3 From 0a35acb8b89603a3135852742f206af82ed61b57 Mon Sep 17 00:00:00 2001 From: Sandip Ransing Date: Wed, 4 Apr 2012 02:10:31 +0530 Subject: rails 4 will support ruby version 1.9.4 or higher --- guides/source/upgrading_ruby_on_rails.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/upgrading_ruby_on_rails.textile b/guides/source/upgrading_ruby_on_rails.textile index e63548abc9..3ac1c31d72 100644 --- a/guides/source/upgrading_ruby_on_rails.textile +++ b/guides/source/upgrading_ruby_on_rails.textile @@ -18,7 +18,7 @@ Rails generally stays close to the latest released Ruby version when it's releas * Rails 3 and above requires Ruby 1.8.7 or higher. Support for all of the previous Ruby versions has been dropped officially and you should upgrade as early as possible. * Rails 3.2.x will be the last branch to support Ruby 1.8.7. -* Rails 4 will support only Ruby 1.9.3. +* Rails 4 will support only Ruby 1.9.3 or higher. TIP: Ruby 1.8.7 p248 and p249 have marshaling bugs that crash Rails. Ruby Enterprise Edition has these fixed since the release of 1.8.7-2010.02. On the 1.9 front, Ruby 1.9.1 is not usable because it outright segfaults, so if you want to use 1.9.x, jump on to 1.9.2 or 1.9.3 for smooth sailing. -- cgit v1.2.3 From ecb4a649c2a9548a3e4725663c295b164c73a678 Mon Sep 17 00:00:00 2001 From: Sandip Ransing Date: Wed, 4 Apr 2012 02:38:37 +0530 Subject: typo mistake fixed correction to server stop statement added --- guides/source/getting_started.textile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guides/source') diff --git a/guides/source/getting_started.textile b/guides/source/getting_started.textile index 0a85c84155..d12606c5de 100644 --- a/guides/source/getting_started.textile +++ b/guides/source/getting_started.textile @@ -152,11 +152,11 @@ $ rails server TIP: Compiling CoffeeScript to JavaScript requires a JavaScript runtime and the absence of a runtime will give you an +execjs+ error. Usually Mac OS X and Windows come with a JavaScript runtime installed. Rails adds the +therubyracer+ gem to Gemfile in a commented line for new apps and you can uncomment if you need it. +therubyrhino+ is the recommended runtime for JRuby users and is added by default to Gemfile in apps generated under JRuby. You can investigate about all the supported runtimes at "ExecJS":https://github.com/sstephenson/execjs#readme. -This will fire up an instance of a webserver built into Ruby called WEBrick by default. To see your application in action, open a browser window and navigate to "http://localhost:3000":http://localhost:3000. You should see Rails' default information page: +This will fire up an instance of a webserver built into Ruby called WEBrick by default. To see your application in action, open a browser window and navigate to "http://localhost:3000":http://localhost:3000. You should see the Rails default information page: !images/rails_welcome.png(Welcome Aboard screenshot)! -TIP: To stop the web server, hit Ctrl+C in the terminal window where it's running. In development mode, Rails does not generally require you to stop the server; changes you make in files will be automatically picked up by the server. +TIP: To stop the web server, hit Ctrl+C in the terminal window where it's running. In development mode, Rails does not generally require you to restart the server; changes you make in files will be automatically picked up by the server. The "Welcome Aboard" page is the _smoke test_ for a new Rails application: it makes sure that you have your software configured correctly enough to serve a page. You can also click on the _About your application’s environment_ link to see a summary of your application's environment. -- cgit v1.2.3 From f89f74896b711d5b073289c9e485e3357c032cc8 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Wed, 4 Apr 2012 12:19:29 +0530 Subject: Revert "rails 4 will support ruby version 1.9.4 or higher" This reverts commit 0a35acb8b89603a3135852742f206af82ed61b57. Reason: Let's cross the bridge when we reach there. --- guides/source/upgrading_ruby_on_rails.textile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides/source') diff --git a/guides/source/upgrading_ruby_on_rails.textile b/guides/source/upgrading_ruby_on_rails.textile index 3ac1c31d72..e63548abc9 100644 --- a/guides/source/upgrading_ruby_on_rails.textile +++ b/guides/source/upgrading_ruby_on_rails.textile @@ -18,7 +18,7 @@ Rails generally stays close to the latest released Ruby version when it's releas * Rails 3 and above requires Ruby 1.8.7 or higher. Support for all of the previous Ruby versions has been dropped officially and you should upgrade as early as possible. * Rails 3.2.x will be the last branch to support Ruby 1.8.7. -* Rails 4 will support only Ruby 1.9.3 or higher. +* Rails 4 will support only Ruby 1.9.3. TIP: Ruby 1.8.7 p248 and p249 have marshaling bugs that crash Rails. Ruby Enterprise Edition has these fixed since the release of 1.8.7-2010.02. On the 1.9 front, Ruby 1.9.1 is not usable because it outright segfaults, so if you want to use 1.9.x, jump on to 1.9.2 or 1.9.3 for smooth sailing. -- cgit v1.2.3