From d1c0d9b15533f0d990fb4095dc3d5598db1d832e Mon Sep 17 00:00:00 2001 From: Cody Robbins Date: Fri, 7 Jun 2013 18:32:50 -0400 Subject: Added a warning about #1769 to the routing guide. --- guides/source/routing.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'guides') diff --git a/guides/source/routing.md b/guides/source/routing.md index 076b9dd176..c6d3b2a58a 100644 --- a/guides/source/routing.md +++ b/guides/source/routing.md @@ -171,6 +171,12 @@ A singular resourceful route generates these helpers: As with plural resources, the same helpers ending in `_url` will also include the host, port and path prefix. +WARNING: A [long-standing bug](https://github.com/rails/rails/issues/1769) prevents `form_for` from working automatically with singular resources. As a workaround, specify the URL for the form directly, like so: + +``` +form_for @geocoder, url: geocoder_path do |f| +``` + ### Controller Namespaces and Routing You may wish to organize groups of controllers under a namespace. Most commonly, you might group a number of administrative controllers under an `Admin::` namespace. You would place these controllers under the `app/controllers/admin` directory, and you can group them together in your router: -- cgit v1.2.3 From 8f39defd29934d63c8b4359a6b8ac747da8e0d18 Mon Sep 17 00:00:00 2001 From: Vishnu Atrai Date: Fri, 14 Jun 2013 00:03:45 +0530 Subject: more guidelines for command line --- guides/source/command_line.md | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'guides') diff --git a/guides/source/command_line.md b/guides/source/command_line.md index e0b44bbf93..0b36f0859f 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -27,6 +27,8 @@ There are a few commands that are absolutely critical to your everyday usage of * `rails dbconsole` * `rails new app_name` +All commands can run with ```-h or --help``` to list more information. + Let's create a simple Rails application to step through each of these commands in context. ### `rails new` @@ -348,6 +350,9 @@ Rake is Ruby Make, a standalone Ruby utility that replaces the Unix utility 'mak You can get a list of Rake tasks available to you, which will often depend on your current directory, by typing `rake --tasks`. Each task has a description, and should help you find the thing you need. +To get the full backtrace for running rake task you can pass the option +```--trace``` to command line, for example ```rake db:create --trace```. + ```bash $ rake --tasks rake about # List versions of all Rails frameworks and the environment @@ -361,6 +366,7 @@ rake middleware # Prints out your Rack middleware stack rake tmp:clear # Clear session, cache, and socket files from tmp/ (narrow w/ tmp:sessions:clear, tmp:cache:clear, tmp:sockets:clear) rake tmp:create # Creates tmp directories for sessions, cache, sockets, and pids ``` +INFO: You can also use ```rake -T``` to get the list of tasks. ### `about` -- cgit v1.2.3 From 57c0b54a915d15370173237fcbd3d14174ba6cb8 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sat, 15 Jun 2013 09:55:05 +0530 Subject: `existant` => `existent` --- guides/source/upgrading_ruby_on_rails.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/upgrading_ruby_on_rails.md b/guides/source/upgrading_ruby_on_rails.md index 35a9617b80..e7e28e21a3 100644 --- a/guides/source/upgrading_ruby_on_rails.md +++ b/guides/source/upgrading_ruby_on_rails.md @@ -61,7 +61,7 @@ end ```ruby class UsersController < ApplicationController def update_name - # Change needed; form_for will try to use a non-existant PATCH route. + # Change needed; form_for will try to use a non-existent PATCH route. end end ``` -- cgit v1.2.3 From 3741dc758f6bd48fa4e44b095fd20b179e981386 Mon Sep 17 00:00:00 2001 From: Vishnu Atrai Date: Sat, 15 Jun 2013 11:01:50 +0530 Subject: replace version 3.2.3 by 4.0.0.beta in command line --- guides/source/command_line.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guides') diff --git a/guides/source/command_line.md b/guides/source/command_line.md index e0b44bbf93..a0255f3de2 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -64,7 +64,7 @@ With no further work, `rails server` will run our new shiny Rails app: $ cd commandsapp $ rails server => Booting WEBrick -=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000 +=> Rails 4.0.0.beta application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2012-05-28 00:39:41] INFO WEBrick 1.3.1 @@ -289,7 +289,7 @@ If you wish to test out some code without changing any data, you can do that by ```bash $ rails console --sandbox -Loading development environment in sandbox (Rails 3.2.3) +Loading development environment in sandbox (Rails 4.0.0.beta) Any modifications you make will be rolled back on exit irb(main):001:0> ``` -- cgit v1.2.3 From 7ca82da6b0d467beed53f0501f6f3d8f9816787e Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sat, 15 Jun 2013 11:07:50 +0530 Subject: `dasboard` => `dashboard` --- guides/source/active_support_instrumentation.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guides') diff --git a/guides/source/active_support_instrumentation.md b/guides/source/active_support_instrumentation.md index 38dbfd3152..969596f470 100644 --- a/guides/source/active_support_instrumentation.md +++ b/guides/source/active_support_instrumentation.md @@ -39,7 +39,7 @@ Action Controller ```ruby { - key: 'posts/1-dasboard-view' + key: 'posts/1-dashboard-view' } ``` @@ -51,7 +51,7 @@ Action Controller ```ruby { - key: 'posts/1-dasboard-view' + key: 'posts/1-dashboard-view' } ``` @@ -63,7 +63,7 @@ Action Controller ```ruby { - key: 'posts/1-dasboard-view' + key: 'posts/1-dashboard-view' } ``` @@ -75,7 +75,7 @@ Action Controller ```ruby { - key: 'posts/1-dasboard-view' + key: 'posts/1-dashboard-view' } ``` -- cgit v1.2.3 From 975080d1e1126d3489e603d89286150b321a9292 Mon Sep 17 00:00:00 2001 From: Vishnu Atrai Date: Sat, 15 Jun 2013 12:26:04 +0530 Subject: date_field docs for action view --- guides/source/action_view_overview.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'guides') diff --git a/guides/source/action_view_overview.md b/guides/source/action_view_overview.md index dea1ddef71..57a157389d 100644 --- a/guides/source/action_view_overview.md +++ b/guides/source/action_view_overview.md @@ -1230,6 +1230,14 @@ Return select and option tags for the given object and method, using `time_zone_ time_zone_select( "user", "time_zone") ``` +#### date_field + +Returns an input tag of the "date" type tailored for accessing a specified attribute. + +```ruby +date_field("user", "dob") +``` + ### FormTagHelper Provides a number of methods for creating form tags that doesn't rely on an Active Record object assigned to the template like FormHelper does. Instead, you provide the names and values manually. @@ -1364,6 +1372,15 @@ text_field_tag 'name' # => ``` +#### date_field_tag + +Creates a standard input field of date type. + +```ruby +date_field_tag "dob" +# => +``` + ### JavaScriptHelper Provides functionality for working with JavaScript in your views. -- cgit v1.2.3 From ecd48f71af4af1dcf49fd9cea42eeaf9fa1d9495 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sat, 15 Jun 2013 13:45:28 +0530 Subject: Change "." to ":" for formatting purpose --- guides/source/getting_started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/getting_started.md b/guides/source/getting_started.md index 2fb0cd7c72..393ed671b0 100644 --- a/guides/source/getting_started.md +++ b/guides/source/getting_started.md @@ -1662,7 +1662,7 @@ Two very common sources of data that are not UTF-8: in the browser. This also applies to your i18n translation files. Most editors that do not already default to UTF-8 (such as some versions of Dreamweaver) offer a way to change the default to UTF-8. Do so. -* Your database. Rails defaults to converting data from your database into UTF-8 at +* Your database: Rails defaults to converting data from your database into UTF-8 at the boundary. However, if your database is not using UTF-8 internally, it may not be able to store all characters that your users enter. For instance, if your database is using Latin-1 internally, and your user enters a Russian, Hebrew, or Japanese -- cgit v1.2.3 From 99dfa35d464fb4c85a744216a7f8e59e2feca086 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sat, 15 Jun 2013 18:43:59 +0530 Subject: Change documentation about contributing to Docs --- guides/source/layout.html.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'guides') diff --git a/guides/source/layout.html.erb b/guides/source/layout.html.erb index ef2bdf0753..1c269e8768 100644 --- a/guides/source/layout.html.erb +++ b/guides/source/layout.html.erb @@ -101,12 +101,12 @@ You're encouraged to help improve the quality of this guide.

- If you see any typos or factual errors you are confident to - patch, please clone <%= link_to 'docrails', 'https://github.com/rails/docrails' %> - and push the change yourself. That branch of Rails has public write access. - Commits are still reviewed, but that happens after you've submitted your - contribution. <%= link_to 'docrails', 'https://github.com/rails/docrails' %> is - cross-merged with master periodically. + If you see any typos or factual errors, you can propose documentation changes to + <%= link_to 'docrails', 'https://github.com/rails/docrails' %>. You can either ask + for commit bit if you'd like to contribute to <%= link_to 'docrails', 'https://github.com/rails/docrails' %> + regularly (Please contact anyone from <%= link_to 'the core team', 'http://rubyonrails.org/core' %>), or + else open a pull request to <%= link_to 'Rails', 'https://github.com/rails/rails' %> itself. + <%= link_to 'docrails', 'https://github.com/rails/docrails' %> is cross-merged with master periodically.

You may also find incomplete content, or stuff that is not up to date. -- cgit v1.2.3 From c64feccc28b0f3f99f9fb748198a429e415005ef Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sat, 15 Jun 2013 19:11:42 +0530 Subject: Update contributing to rails guide to depict new contributing to documentation info --- guides/source/contributing_to_ruby_on_rails.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/contributing_to_ruby_on_rails.md b/guides/source/contributing_to_ruby_on_rails.md index 0bfa646b81..b9f42fa51b 100644 --- a/guides/source/contributing_to_ruby_on_rails.md +++ b/guides/source/contributing_to_ruby_on_rails.md @@ -184,7 +184,9 @@ Ruby on Rails has two main sets of documentation: the guides help you in learnin You can help improve the Rails guides by making them more coherent, consistent or readable, adding missing information, correcting factual errors, fixing typos, or bringing it up to date with the latest edge Rails. To get involved in the translation of Rails guides, please see [Translating Rails Guides](https://wiki.github.com/rails/docrails/translating-rails-guides). -If you're confident about your changes, you can push them directly yourself via [docrails](https://github.com/rails/docrails). Docrails is a branch with an **open commit policy** and public write access. Commits to docrails are still reviewed, but this happens after they are pushed. Docrails is merged with master regularly, so you are effectively editing the Ruby on Rails documentation. +You can either ask for commit bit if you'd like to contribute to [Docrails](http://github.com/rails/docrails) regularly (Please contact anyone from [the core team](http://rubyonrails.org/core)), or else open a pull request to [Rails](http://github.com/rails/rails) itself. + +Docrails is merged with master regularly, so you are effectively editing the Ruby on Rails documentation. If you are unsure of the documentation changes, you can create an issue in the [Rails](https://github.com/rails/rails/issues) issues tracker on GitHub. -- cgit v1.2.3 From 6359a5dbd25edc42f8692b9c8f3897ee4ff3fea4 Mon Sep 17 00:00:00 2001 From: Vijay Dev Date: Sat, 15 Jun 2013 19:37:22 +0530 Subject: reword the docrails info [ci skip] --- guides/source/layout.html.erb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'guides') diff --git a/guides/source/layout.html.erb b/guides/source/layout.html.erb index 1c269e8768..c737a0e9dc 100644 --- a/guides/source/layout.html.erb +++ b/guides/source/layout.html.erb @@ -101,12 +101,14 @@ You're encouraged to help improve the quality of this guide.

- If you see any typos or factual errors, you can propose documentation changes to - <%= link_to 'docrails', 'https://github.com/rails/docrails' %>. You can either ask - for commit bit if you'd like to contribute to <%= link_to 'docrails', 'https://github.com/rails/docrails' %> - regularly (Please contact anyone from <%= link_to 'the core team', 'http://rubyonrails.org/core' %>), or - else open a pull request to <%= link_to 'Rails', 'https://github.com/rails/rails' %> itself. - <%= link_to 'docrails', 'https://github.com/rails/docrails' %> is cross-merged with master periodically. + If you see any typos or factual errors that you are confident to fix, + you can push the fix to <%= link_to 'docrails', 'https://github.com/rails/docrails' %> (Ask + the <%= link_to 'Rails core team', 'http://rubyonrails.org/core' %> for push access). + If you choose to open a pull request, please do it in <%= link_to 'Rails', 'https://github.com/rails/rails' %> + and not in the <%= link_to 'docrails', 'https://github.com/rails/docrails' %> repository. + Commits made to docrails are still reviewed, but that happens after you've submitted your + contribution. <%= link_to 'docrails', 'https://github.com/rails/docrails' %> is + cross-merged with master periodically.

You may also find incomplete content, or stuff that is not up to date. -- cgit v1.2.3 From d4794fd9d2bd29473c0968eec7054667abdf0c7a Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Sat, 15 Jun 2013 18:09:07 +0300 Subject: Use markdown quotes instead tag --- guides/source/association_basics.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'guides') diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index d7277b487f..adf430aef4 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -781,7 +781,7 @@ The `create_association` method returns a new object of the associated type. Thi ##### `create_association!(attributes = {})` -Does the same as create_association above, but raises ActiveRecord::RecordInvalid if the record is invalid. +Does the same as `create_association` above, but raises `ActiveRecord::RecordInvalid` if the record is invalid. #### Options for `belongs_to` @@ -1083,7 +1083,7 @@ The `create_association` method returns a new object of the associated type. Thi ##### `create_association!(attributes = {})` -Does the same as create_association above, but raises ActiveRecord::RecordInvalid if the record is invalid. +Does the same as `create_association` above, but raises `ActiveRecord::RecordInvalid` if the record is invalid. #### Options for `has_one` @@ -1443,7 +1443,7 @@ The `collection.create` method returns a new object of the associated type. This ##### `collection.create!(attributes = {})` -Does the same as collection.create above, but raises ActiveRecord::RecordInvalid if the record is invalid. +Does the same as `collection.create` above, but raises `ActiveRecord::RecordInvalid` if the record is invalid. #### Options for `has_many` @@ -1936,7 +1936,7 @@ The `collection.create` method returns a new object of the associated type. This ##### `collection.create!(attributes = {})` -Does the same as collection.create, but raises ActiveRecord::RecordInvalid if the record is invalid. +Does the same as `collection.create`, but raises `ActiveRecord::RecordInvalid` if the record is invalid. #### Options for `has_and_belongs_to_many` @@ -2199,4 +2199,4 @@ Extensions can refer to the internals of the association proxy using these three * `proxy_association.owner` returns the object that the association is a part of. * `proxy_association.reflection` returns the reflection object that describes the association. -* `proxy_association.target` returns the associated object for `belongs_to` or `has_one`, or the collection of associated objects for `has_many` or `has_and_belongs_to_many`. \ No newline at end of file +* `proxy_association.target` returns the associated object for `belongs_to` or `has_one`, or the collection of associated objects for `has_many` or `has_and_belongs_to_many`. -- cgit v1.2.3 From 1010f9382b81f5f3a02009126271ac0cbde4bc59 Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Sat, 15 Jun 2013 18:39:17 +0300 Subject: fix quotes and ruby old hashes --- guides/source/association_basics.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guides') diff --git a/guides/source/association_basics.md b/guides/source/association_basics.md index adf430aef4..c0e584a1c7 100644 --- a/guides/source/association_basics.md +++ b/guides/source/association_basics.md @@ -1736,15 +1736,15 @@ If you want to make sure that, upon insertion, all of the records in the persisted association are distinct (so that you can be sure that when you inspect the association that you will never find duplicate records), you should add a unique index on the table itself. For example, if you have a table named -``person_posts`` and you want to make sure all the posts are unique, you could +`person_posts` and you want to make sure all the posts are unique, you could add the following in a migration: ```ruby -add_index :person_posts, :post, :unique => true +add_index :person_posts, :post, unique: true ``` -Note that checking for uniqueness using something like ``include?`` is subject -to race conditions. Do not attempt to use ``include?`` to enforce distinctness +Note that checking for uniqueness using something like `include?` is subject +to race conditions. Do not attempt to use `include?` to enforce distinctness in an association. For instance, using the post example from above, the following code would be racy because multiple users could be attempting this at the same time: -- cgit v1.2.3 From 03e3a2a2532c9b29abaf82c841f7b4cdbd3d1225 Mon Sep 17 00:00:00 2001 From: Mikhail Dieterle Date: Sun, 16 Jun 2013 00:10:43 +0300 Subject: reorder finder methods list alphabetically --- guides/source/active_record_querying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/active_record_querying.md b/guides/source/active_record_querying.md index 84fc254207..5fcc666f33 100644 --- a/guides/source/active_record_querying.md +++ b/guides/source/active_record_querying.md @@ -58,6 +58,7 @@ The methods are: * `bind` * `create_with` +* `distinct` * `eager_load` * `extending` * `from` @@ -76,7 +77,6 @@ The methods are: * `reorder` * `reverse_order` * `select` -* `distinct` * `uniq` * `where` -- cgit v1.2.3 From 8bb165e9e02ab7ce8d4e2ec9372ca33e253cb500 Mon Sep 17 00:00:00 2001 From: Vishnu Atrai Date: Sun, 16 Jun 2013 11:52:46 +0530 Subject: change rails verison to 4.0.0 in command line --- guides/source/command_line.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'guides') diff --git a/guides/source/command_line.md b/guides/source/command_line.md index ec3ba9d704..71bf60d800 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -66,7 +66,7 @@ With no further work, `rails server` will run our new shiny Rails app: $ cd commandsapp $ rails server => Booting WEBrick -=> Rails 4.0.0.beta application starting in development on http://0.0.0.0:3000 +=> Rails 4.0.0 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2012-05-28 00:39:41] INFO WEBrick 1.3.1 @@ -291,7 +291,7 @@ If you wish to test out some code without changing any data, you can do that by ```bash $ rails console --sandbox -Loading development environment in sandbox (Rails 4.0.0.beta) +Loading development environment in sandbox (Rails 4.0.0) Any modifications you make will be rolled back on exit irb(main):001:0> ``` @@ -378,12 +378,12 @@ About your application's environment Ruby version 1.9.3 (x86_64-linux) RubyGems version 1.3.6 Rack version 1.3 -Rails version 4.0.0.beta +Rails version 4.0.0 JavaScript Runtime Node.js (V8) -Active Record version 4.0.0.beta -Action Pack version 4.0.0.beta -Action Mailer version 4.0.0.beta -Active Support version 4.0.0.beta +Active Record version 4.0.0 +Action Pack version 4.0.0 +Action Mailer version 4.0.0 +Active Support version 4.0.0 Middleware ActionDispatch::Static, Rack::Lock, Rack::Runtime, Rack::MethodOverride, ActionDispatch::RequestId, Rails::Rack::Logger, ActionDispatch::ShowExceptions, ActionDispatch::DebugExceptions, ActionDispatch::RemoteIp, ActionDispatch::Reloader, ActionDispatch::Callbacks, ActiveRecord::Migration::CheckPending, ActiveRecord::ConnectionAdapters::ConnectionManagement, ActiveRecord::QueryCache, ActionDispatch::Cookies, ActionDispatch::Session::EncryptedCookieStore, ActionDispatch::Flash, ActionDispatch::ParamsParser, Rack::Head, Rack::ConditionalGet, Rack::ETag Application root /home/foobar/commandsapp Environment development -- cgit v1.2.3 From ebc7531a0ab301976cc86282652394fa01ba7b48 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Sun, 16 Jun 2013 12:44:41 +0530 Subject: Fix TOC ul markup --- guides/source/kindle/toc.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/kindle/toc.html.erb b/guides/source/kindle/toc.html.erb index e013797dee..f310edd3a1 100644 --- a/guides/source/kindle/toc.html.erb +++ b/guides/source/kindle/toc.html.erb @@ -20,5 +20,5 @@ Ruby on Rails Guides

  • Credits
  • Copyright & License
  • -
      +
    -- cgit v1.2.3 From 6946fffd6362bbb3447c1fbc4d8e155f9ced5f4f Mon Sep 17 00:00:00 2001 From: Chandresh Pant Date: Mon, 17 Jun 2013 13:51:59 +0530 Subject: rewrote render tag using more succinct and idiomatic way --- guides/source/working_with_javascript_in_rails.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'guides') diff --git a/guides/source/working_with_javascript_in_rails.md b/guides/source/working_with_javascript_in_rails.md index 22a59cdfec..bd0c796673 100644 --- a/guides/source/working_with_javascript_in_rails.md +++ b/guides/source/working_with_javascript_in_rails.md @@ -278,9 +278,7 @@ The index view (`app/views/users/index.html.erb`) contains: Users
      -<% @users.each do |user| %> - <%= render user %> -<% end %> +<%= render @users %>

    -- cgit v1.2.3 From 11cae34701d0076c3c5ca2fa110c64efd7dc02d1 Mon Sep 17 00:00:00 2001 From: Rashmi Yadav Date: Wed, 19 Jun 2013 19:01:33 +0200 Subject: [doc] Update return false if record is invalid --- guides/source/active_record_validations.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'guides') diff --git a/guides/source/active_record_validations.md b/guides/source/active_record_validations.md index 37790c62b1..3bfc600e7c 100644 --- a/guides/source/active_record_validations.md +++ b/guides/source/active_record_validations.md @@ -120,8 +120,8 @@ database only if the object is valid: * `update!` The bang versions (e.g. `save!`) raise an exception if the record is invalid. -The non-bang versions don't: `save` and `update` return `false`, -`create` and `update` just return the objects. +The non-bang versions don't, `save` and `update` return `false`, +`create` just return the objects. ### Skipping Validations -- cgit v1.2.3 From a6f44db052803bd94bd27869dedd6f11bb70c647 Mon Sep 17 00:00:00 2001 From: Rashmi Yadav Date: Sun, 23 Jun 2013 09:59:37 +0200 Subject: [doc] Info added for tmp:create [ci skip] --- guides/source/command_line.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/command_line.md b/guides/source/command_line.md index 71bf60d800..218b4dd39a 100644 --- a/guides/source/command_line.md +++ b/guides/source/command_line.md @@ -474,12 +474,13 @@ Rails comes with a test suite called `Test::Unit`. Rails owes its stability to t The `Rails.root/tmp` directory is, like the *nix /tmp directory, the holding place for temporary files like sessions (if you're using a file store for files), process id files, and cached actions. -The `tmp:` namespaced tasks will help you clear the `Rails.root/tmp` directory: +The `tmp:` namespaced tasks will help you clear and create the `Rails.root/tmp` directory: * `rake tmp:cache:clear` clears `tmp/cache`. * `rake tmp:sessions:clear` clears `tmp/sessions`. * `rake tmp:sockets:clear` clears `tmp/sockets`. * `rake tmp:clear` clears all the three: cache, sessions and sockets. +* `rake tmp:create` creates tmp directories for sessions, cache, sockets, and pids. ### Miscellaneous -- cgit v1.2.3 From 059f9f03941a65baf400b4444e7eddd999397f94 Mon Sep 17 00:00:00 2001 From: Anton Cherepanov Date: Thu, 20 Jun 2013 10:31:08 +0600 Subject: Added markdown tag for highlight --- guides/source/routing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/routing.md b/guides/source/routing.md index c6d3b2a58a..2a681e3ab5 100644 --- a/guides/source/routing.md +++ b/guides/source/routing.md @@ -173,7 +173,7 @@ As with plural resources, the same helpers ending in `_url` will also include th WARNING: A [long-standing bug](https://github.com/rails/rails/issues/1769) prevents `form_for` from working automatically with singular resources. As a workaround, specify the URL for the form directly, like so: -``` +```ruby form_for @geocoder, url: geocoder_path do |f| ``` -- cgit v1.2.3 From b437502f8bbef266e1e931ce7802c060e0ae75dd Mon Sep 17 00:00:00 2001 From: Gustavo Delfino Date: Sun, 9 Jun 2013 08:39:09 -0430 Subject: Mention Content-Type for JSON params parsing. http://stackoverflow.com/questions/8501021/rails-json-request-is-not-parsed-correctly-into-post-parameters --- guides/source/action_controller_overview.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guides') diff --git a/guides/source/action_controller_overview.md b/guides/source/action_controller_overview.md index 2701f5bb72..6a91418e1f 100644 --- a/guides/source/action_controller_overview.md +++ b/guides/source/action_controller_overview.md @@ -129,7 +129,7 @@ Note that the `params` hash is actually an instance of `ActiveSupport::HashWithI ### JSON parameters -If you're writing a web service application, you might find yourself more comfortable accepting parameters in JSON format. Rails will automatically convert your parameters into the `params` hash, which you can access as you would normally. +If you're writing a web service application, you might find yourself more comfortable accepting parameters in JSON format. If the "Content-Type" header of your request is set to "application/json", Rails will automatically convert your parameters into the `params` hash, which you can access as you would normally. So for example, if you are sending this JSON content: -- cgit v1.2.3