Q:

how to tell anchor tag to got to this action in controller in rails

I am new to ruby on rails. I am having problem in routes. I have a navigation menu. I have one controller home. Inside home controller I have several actions/methods. So when user clicks home, it should take user to home page by going to home controller inside home index action. When user clicks on contact then it should take him to contact action inside home controller. same goes to other links. 
What I am doing is here
%a{:href => 'home'} Home
%a{:href => 'home/contact'} Contact

So when I click on contact it gives me routing error
No route matches [GET] "/home/contact"

How can I solve this problem?

A:

I understand you're new to rails. It looks like you have yet to read the details of how the routing works with rails.
I'd recommend starting by familiarizing yourself with the Rails guide: Routing from the Outside In. That guide describes some simple shortcuts you can use to make setting routes up much easier.
For example, one way to accomplish what you're trying to do would be to use the following:
In your /config/routes.rb file, put entries like these for the links you want:
  root :to => "home#home"
  get "home/index", :to => "home#index", :as => 'home_index'
  get "home/about", :to => "home#about", :as => 'about'
  get "home/contact", :to => "home#contact", :as => 'contact'

These will create short-cuts like root_path,  home_index_path, about_path, contact_path, etc that you can use in your views. 
Then in your view, you'd use:
 %a{:href => home_index_path } Home
 %a{:href => contact_path } Contact

This is just te beginning of how you can use the paths. You'll want to also learn how to use rails 'restful routing' and how to put resources in your routing file, but that's probably beyond what you need for right now.

