Question: I am new to ruby on rails and stuck to very basic problem.I have created a controller named as custom\_hello and define 2 methods. what i want is when i click on the link it will take me to next page which is under the same controller.i just don't know how to configure the routes properly.Any help would be appreciated...

Answer: 
Here it is:

`app/controllers/custom_hello_controller.rb`

```
class CustomHelloController < ApplicationController
  def method1
  end

  def method2
  end
end

```

`config/routes.rb`

```
get 'custom_hello/method1'
get 'custom_hello/method2'

```

Create 2 files in your views:

```
app/views/custom_hello/method1.html.erb
app/views/custom_hello/method2.html.erb

```

You can create links with:

```
<%= link_to 'Method 1', custom_hello_method1_path %>
<%= link_to 'Method 2', custom_hello_method2_path %>

```

However, you may consider creating RESTful controllers and routes. Please read [here](http://guides.rubyonrails.org/routing.html)
```
<%= link_to 'link_name', :action => 'Your_method_name', :controller => 'custom_hello' %>

```

now you need to write `'custome_hello/Your_method_name'` in your `routes.rb` and create `Your_method_name.html.erb` page in that controller when you click on link you will navigate to `Your_method_name.html.erb` page try it, this will work.