Commit Graph

114 Commits

Author SHA1 Message Date
Andrew White
6fdc379c19 Add section to routing guide about config/routes.rb [ci skip]
Closes #32219.
2018-03-12 13:42:08 +00:00
Benoit Tigeot
c6d928f3ca Add --expanded option to "rails routes"
When using rails routes with small terminal or complicated routes it can be
very difficult to understand where is the element listed in header. psql
had the same issue, that's why they created "expanded mode" you can
switch using `\x` or by starting psql with
```
-x
--expanded

    Turn on the expanded table formatting mode. This is equivalent to the \x command.
```
The output is similar to one implemented here for rails routes:

db_user-# \du
List of roles
-[ RECORD 1 ]----------------------------------------------
Role name  | super
Attributes | Superuser, Create role, Create DB
Member of  | {}
-[ RECORD 2 ]----------------------------------------------
Role name  | role
Attributes | Superuser, Create role, Create DB, Replication
Member of  | {}
2018-02-28 22:32:34 +01:00
Avneet Singh Malhotra
1439a54236 Correct to option's value of the route in the Bound Parameters section in routing guide. 2018-02-26 19:20:31 +05:30
Yoshiyuki Hirano
3dc774f371 [ci skip] Update routing guide for Direct
* Added the direct method to routing guide.
2017-12-12 14:07:58 +09:00
Mariano Giagante
b1638a8cfa Replaces the 17 for the actual call to params[:id] that would make the code work as intended. [ci skip] 2017-08-06 12:43:57 -03:00
ydakuka
0e523ffc28 Squashed commit of the following:
commit 4a3d295f3011e771cddead80de7497ca15d15c13
Author: Yauheni Dakuka <yauheni.dakuka@gmail.com>
Date:   Fri Jul 28 14:31:35 2017 +0300

    Update routing.md

commit 620a4ce47288e3ef6504290c78f931214968e7e3
Author: Yauheni Dakuka <yauheni.dakuka@gmail.com>
Date:   Fri Jul 28 14:19:29 2017 +0300

    [ci skip] update routing guide
2017-07-28 15:44:10 +03:00
Yauheni Dakuka
bb5f29bfb7 [ci skip] update routing guide 2017-07-28 11:35:09 +03:00
Sean Griffin
9914964514 Merge pull request #27662 from nhorton/patch-1
Fixing  "Adding Member Routes" documentation
2017-07-17 11:42:27 -04:00
Dzianis Dashkevich
04b9d68297
Update routing doc on the get to: option [ci skip] 2017-04-11 18:50:05 +03:00
claudiob
0b4ff7eacf Fix Guides to include #23138 [ci skip]
A long-standing bug has been fixed in Rails 5.1 by @pixeltrix
See https://github.com/rails/rails/blame/5-1-stable/actionpack/CHANGELOG.md#L52-L64

This PR updates the guides accordingly.

Before:
<img width="799" alt="before" src="https://cloud.githubusercontent.com/assets/10076/24809105/4ec7066c-1b73-11e7-98c6-c709c3465306.png">

After:
<img width="799" alt="after" src="https://cloud.githubusercontent.com/assets/10076/24809109/50b21188-1b73-11e7-8a1a-32c3d0ed512a.png">
2017-04-07 09:23:18 -07:00
Jon Moss
b68aae003a Small grammar fix
[ci skip]
2017-03-30 15:57:32 -04:00
Noah Horton
4906d9029e Fixing "Adding Member Routes" documentation
Previously said the helpers were preview_photo_url and preview_photo_path, i.e. action_resource, when in fact they are resource_action.  i.e. photo_preview_path.  Fixed.
2017-01-12 15:22:44 -07:00
Brandon Weaver
6a116bd909 Add note on defaults block option
When I was looking for how to default the entire routes file to JSON I could only find the postfix option. It was mentioned on IRC that you could do this with a block as well and I had not found it in the documentation.
2016-12-14 17:17:44 -08:00
Will Jordan
8c1fdf679e Remove :action and :controller segments from routing guide
Fixes #26247.
[ci skip]
2016-08-22 17:19:28 +00:00
Jon Moss
578ae253df
Light grammar edits to beginning of Routing guide
[ci skip]
2016-05-18 09:07:01 -04:00
Jon Moss
7c94db1370 Remove incorrect Rack documentation example
`Sprockets` does not respond to the call method, so I changed the
example to use a fake `MyRackApp`.

Closes #22579.

[ci skip]
2016-03-07 12:47:08 -05:00
Vipul A M
ef2a8c2391 - Fixed and removed long arguments to rake routes
- Fixed related documentation and usage all around

Fixes #23561
2016-02-12 14:35:57 +05:30
yuuji.yaginuma
fae1724398 use rails command in routes task
For other task has become to use the rails command at doc and test,
I think that routes task also it is better to use the rails command.
2016-02-03 08:17:25 +09:00
Vipul A M
8a436fdd98 Add options for rake routes task
Add two options: `-c` and `-g`.
`-g` option returns the urls name, verb and path fields that match the pattern.
`-c` option returns the urls for specific controller.

Fixes #18902, and Fixes #20420

[Anton Davydov & Vipul A M]
2016-02-02 00:27:30 +05:30
Fernando Seror
1307c8d0ea Update the exception of format constraint in routes
Per https://github.com/rails/rails/issues/20264
[ci skip]
2016-01-23 19:15:46 -06:00
Gaurav Sharma
352a8892fd use bin/rails default instead of rake commands [ci skip]
I go through the `http://edgeguides.rubyonrails.org/` and found `rake` commands in various files that are in RAILS 5.0 implement by `bin/rails` command. I try to change all that can be directly use `bin/rails …`
2016-01-19 23:47:14 +05:30
Dave Powers
6c9a2b5ab6 Fix letter case and grammar in Routing guide 2015-12-22 14:32:03 -05:00
Genadi Samokovarov
c29fbd3c7a ApplicationRecord documentation pass
This is a pass over the documentation which fills the missing gaps of
`ApplicationRecord`.

[ci skip]
2015-12-17 11:56:35 +01:00
Arthur Nogueira Neves
312485f3e8 Merge pull request #22283 from the-undefined/routes-error-singular-resource
[ci skip] add `controller:` argument to routing.md
2015-11-28 12:47:17 -05:00
the-undefined
3fccecb87b [ci skip] add controller: argument to routing.md
Passing a `Symbol` to the `to:` argument for a `get` route requires a `controller` argument to also be defined.
The documentation is missing the `controller:` argument, which leaving out raises a routing exception:

```ruby
get 'profile', to: :show
```

```
$ rake routes
ArgumentError: Missing :controller key on routes definition, please check your routes.
```

Adding the `controller:` argument maps the route correctly:

```ruby
get 'profile', to: :show, controller: 'users'
```
```
$ rake routes
profile GET    /profile(.:format)  users#show
```
2015-11-13 14:32:23 +00:00
yui-knk
666e2cc654 [ci skip] Replace "destroy method" with destroy action
Sure this is `destroy` method of PhotosController, but in this chapter
these methods which mapped by the router are called "action".
For example:

```ruby
get '/patients/:id', to: 'patients#show'
```

is described to dispatch "controller's `show` action".
2015-10-20 20:24:07 +09:00
tanmay3011
148d1217a1 [ci skip] Change 'an URL' to 'a URL' as URL doesn't have a vowel sound 2015-10-06 23:34:05 +05:30
Thiago Augusto
89c53ece47 Update routing.md 2015-09-22 10:17:43 -03:00
Robin Dupret
f51d142881 Tiny documentation fixes [ci skip] 2015-08-11 15:35:35 +02:00
Claudio B.
644c4efdc9 Merge pull request #21177 from brooksreese/single_crud_operation
[ci skip] Note that each action maps to a specific CRUD operation
2015-08-09 11:12:03 -07:00
Brooks Reese
0082ffeff1 [ci skip] Note that each action maps to a specific CRUD operation 2015-08-09 11:16:20 -05:00
yui-knk
235155302e [ci skip] Add an explanation for status option 2015-08-08 12:27:55 +09:00
Andrew White
aa79574d09 Add note to routing guide about overriding defaults [ci skip]
Fixes #21085.
2015-08-03 11:50:12 +01:00
yui-knk
2ea95a522a [ci skip]
Add descriptions about `ActiveRecord::Base#to_param` to

* `ActionDispatch::Routing::Base#match`
* Overriding Named Route Parameters (guide)

When passes `:param` to route definision, always `to_param` method of
related model is overridden to constructe an URL by passing these
model instance to named_helper.
2015-08-01 23:08:53 +09:00
Robin Dupret
27eccc27cb A few documentation tweaks [ci skip]
[Robin Dupret & Shunsuke Aida]
2015-06-07 14:53:24 +02:00
Zachary Scott
c5ee5cf582 s/snipped/snippet for @senny :trollface: 2015-05-06 22:31:22 -07:00
Ankit Gupta
81a87308bb Adding a note, snipped for brevity
sudden ending of form looks incomplete and catches [ci skip]
2015-05-05 18:58:56 -04:00
Jonan Scheffler
21a2d9a987 Update routing.md
This adds instructions for routing to rack applications with mount instead of match.

I just spent an unreasonable amount of time staring at this, hopefully the next person will save some time. It's possible that the docs should simply advise people to use mount and leave out the match method but I don't know enough about the differences in the two approaches to assert that definitively.
2015-04-01 00:37:23 -03:00
Vijay Dev
c26ee64b92 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/4_0_release_notes.md
2015-03-26 16:22:41 +00:00
yui-knk
7560c3c8ca [ci skip] Change to code element 2015-03-11 22:57:10 +09:00
yui-knk
5df7866ba0 Add backquote to :as option. 2015-03-11 13:55:40 +09:00
Kevin Jayanthan
c7172f5040 Fixing incorrect class name used in an example.
On "Controller Namespaces and Routing" section of the "Rails Routing from the Outside In" , the examples are using "AritclesController" as an example of a controller, to show different organizers. But on the line 232, it incorrectly uses "PostsController" instead of "AritclesController".
2015-03-02 14:56:31 +05:30
Vipul A M
5cfaf5a46e - Changed IN to ON in markdown renderer condition
- Changed `IN` to `ON` in all note sentences in guides.
2015-01-14 11:52:13 +05:30
Xavier Noria
7702974281 warn about reading guides in GitHub
References #18148.
2014-12-23 23:32:50 +01:00
Yves Senn
b8fbcc0787 Merge pull request #16799 from rramsden/fix-typo
[ci skip] Fix typo in rails guide for routing
2014-09-04 10:27:49 +02:00
Richard Ramsden
633f72cf0c [ci skip] Fix typo in rails guide for routing 2014-09-04 14:45:08 +09:00
Zachary Scott
a240ad0c89 💅 from #16329 [ci skip] 2014-07-29 10:28:56 -07:00
Deepender Singla
3d42330048 Get request should not write to database note added. [skip ci] 2014-07-29 22:48:50 +05:30
yuuji.yaginuma
7464d00dd7 [ci skip] Fix code in Routing Guide 2014-07-21 11:27:20 +09:00
Zachary Scott
d5601041fe Add @senny's changed from #14741, including code font for resources
options, and wrapped to 80 chars. [ci skip]
2014-05-29 00:20:40 -07:00