How to use company_name on the url instead of company_id

Hi all, How to use company_name on the url instead of company_id.

This is my routes:

get 'company/:company_id' => 'company#company', as: :company

This is my controller:

@company_view = Company.find(params[:company_id])

This is view:

<%=link_to company.company_name, company_path(:company_id => company_id)
%>

Thanks

This should help.

http://api.rubyonrails.org/classes/ActiveRecord/Integration/ClassMethods.html#method-i-to_param