# How knows my paths in link\_to? If I do not defined

**URL:** <https://www.ruby-forum.com/t/how-knows-my-paths-in-link-to-if-i-do-not-defined/172702>\
**Category:** Rails\
**Created:** [July 26, 2009, 4:16am UTC](https://www.ruby-forum.com/t/how-knows-my-paths-in-link-to-if-i-do-not-defined/172702 "2009-07-26T04:16:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruhtra01](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@ruhtra01](https://www.ruby-forum.com/u/ruhtra01)\
**Post date:** [July 26, 2009, 4:16am UTC](https://www.ruby-forum.com/t/how-knows-my-paths-in-link-to-if-i-do-not-defined/172702/1 "2009-07-26T04:16:32Z")

</div>

Hello,  
ItÂ´s my first post here. 🙂  
IÂ´l following the guide of Ruby, but I need to know how the Ruby knows  
my path to other pages if I did not define anything, like this:

app/views/posts/index.html.erb:  
\<%= link\_to ‘Show’, post %\>  
\<%= link\_to ‘Edit’, edit\_post\_path(post) %\>

Other path(home/index.html.erb):  
\<%= link\_to “My first blog in Ruby on Rails”, posts\_path %\>

I need help to know how Ruby knows the path of “post”,  
“edit\_post\_path(post)” and “posts\_path”?

Thank you all!

ps:  
The link that IÂ´m following:

> **[Getting Started with Rails — Ruby on Rails Guides](https://guides.rubyonrails.org/getting_started.html#creating-the-blog-application)**
>
> Getting Started with RailsThis guide covers getting up and running with Ruby on Rails.After reading this guide, you will know: How to install Rails, create a new Rails application, and connect your application to a database. The general layout of a...

---

<div class="post-metadata">

**Author:** ![ruhtra01](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@ruhtra01](https://www.ruby-forum.com/u/ruhtra01)\
**Post date:** [July 26, 2009, 4:24am UTC](https://www.ruby-forum.com/t/how-knows-my-paths-in-link-to-if-i-do-not-defined/172702/2 "2009-07-26T04:24:01Z")

</div>

This is the convention over configuration thing.  
Once you define your map.resources in routes.rb, rails does the rest.

documentation for  
public instance method resources(\*entities, &block)  
in ActionController::Resources in lib\action\_controller\resources.rb  
has more information

---

<div class="post-metadata">

**Author:** ![ruhtra01](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/76d3ee/32.png) [@ruhtra01](https://www.ruby-forum.com/u/ruhtra01)\
**Post date:** [July 26, 2009, 5:16am UTC](https://www.ruby-forum.com/t/how-knows-my-paths-in-link-to-if-i-do-not-defined/172702/3 "2009-07-26T05:16:35Z")

</div>

Now I understood! I search more about it in Ruby documentation too.  
Thank you! 🙂
