diff options
Diffstat (limited to 'railties/guides')
4 files changed, 13 insertions, 9 deletions
diff --git a/railties/guides/rails_guides/generator.rb b/railties/guides/rails_guides/generator.rb index 14d671c8f3..2219fcea66 100644 --- a/railties/guides/rails_guides/generator.rb +++ b/railties/guides/rails_guides/generator.rb @@ -227,13 +227,13 @@ module RailsGuides end code_blocks.push(<<HTML) -<notextile> +<notextile> <div class="code_container"> <pre class="brush: #{brush}; gutter: false; toolbar: false"> #{ERB::Util.h($2).strip} </pre> </div> -</notextile> +</notextile> HTML "\ndirty_workaround_for_notextile_#{code_blocks.size - 1}\n" end @@ -280,3 +280,4 @@ HTML end end end + diff --git a/railties/guides/rails_guides/textile_extensions.rb b/railties/guides/rails_guides/textile_extensions.rb index 352c5e91dd..dd51e0d66b 100644 --- a/railties/guides/rails_guides/textile_extensions.rb +++ b/railties/guides/rails_guides/textile_extensions.rb @@ -25,7 +25,7 @@ module RailsGuides def plusplus(body) body.gsub!(/\+(.*?)\+/) do |m| - "<notextile><tt>#{$1}</tt></notextile>" + "<notextile><tt>#{$1}</tt></notextile>" end # The real plus sign @@ -36,8 +36,9 @@ module RailsGuides body.gsub!(%r{<(yaml|shell|ruby|erb|html|sql|plain)>(.*?)</\1>}m) do |m| es = ERB::Util.h($2) css_class = $1.in?(['erb', 'shell']) ? 'html' : $1 - %{<notextile><div class="code_container"><code class="#{css_class}">#{es}</code></div></notextile>} + %{<notextile><div class="code_container"><code class="#{css_class}">#{es}</code></div></notextile>} end end end end + diff --git a/railties/guides/source/active_support_core_extensions.textile b/railties/guides/source/active_support_core_extensions.textile index a0ed85cf01..b35e04d7e1 100644 --- a/railties/guides/source/active_support_core_extensions.textile +++ b/railties/guides/source/active_support_core_extensions.textile @@ -78,12 +78,14 @@ The following values are considered to be blank in a Rails application: * +nil+ and +false+, -* strings composed only of whitespace, i.e. matching +/\A\s*\z/+, +* strings composed only of whitespace (see note below), * empty arrays and hashes, and * any other object that responds to +empty?+ and it is empty. +INFO: In Ruby 1.9 the predicate for strings uses the Unicode-aware character class <tt>[:space:]</tt>, so for example U+2029 (paragraph separator) is considered to be whitespace. In Ruby 1.8 whitespace is considered to be <tt>\s</tt> together with the ideographic space U+3000. + WARNING: Note that numbers are not mentioned, in particular 0 and 0.0 are *not* blank. For example, this method from +ActionDispatch::Session::AbstractStore+ uses +blank?+ for checking whether a session key is present: diff --git a/railties/guides/source/routing.textile b/railties/guides/source/routing.textile index 57e390f385..68fb22f5d8 100644 --- a/railties/guides/source/routing.textile +++ b/railties/guides/source/routing.textile @@ -823,10 +823,10 @@ If you want a complete list of all of the available routes in your application, For example, here's a small section of the +rake routes+ output for a RESTful route: <pre> - users GET /users {:controller=>"users", :action=>"index"} -formatted_users GET /users.:format {:controller=>"users", :action=>"index"} - POST /users {:controller=>"users", :action=>"create"} - POST /users.:format {:controller=>"users", :action=>"create"} + users GET /users(.:format) users#index + POST /users(.:format) users#create + new_user GET /users/new(.:format) users#new +edit_user GET /users/:id/edit(.:format) users#edit </pre> You may restrict the listing to the routes that map to a particular controller setting the +CONTROLLER+ environment variable: |