# How can i hide controller and action name in url

**URL:** <https://www.ruby-forum.com/t/how-can-i-hide-controller-and-action-name-in-url/191608>\
**Category:** Rails\
**Created:** [July 15, 2010, 9:34am UTC](https://www.ruby-forum.com/t/how-can-i-hide-controller-and-action-name-in-url/191608 "2010-07-15T09:34:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![amitjain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@amitjain](https://www.ruby-forum.com/u/amitjain)\
**Post date:** [July 15, 2010, 9:34am UTC](https://www.ruby-forum.com/t/how-can-i-hide-controller-and-action-name-in-url/191608/1 "2010-07-15T09:34:00Z")

</div>

Hi All,

I am new in ROR.

I want to hide controller and action name from url.

exp. my current url:

```
 http://localhost:3000/triggers/index/amit123

```

expected:

[http://localhost:3000/amit123](http://localhost:3000/amit123)

remove controller(trigger) and action(index) name from url.

please help me.

Thanks

Amit Jain

---

<div class="post-metadata">

**Author:** ![amitjain](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/13edae/32.png) [@amitjain](https://www.ruby-forum.com/u/amitjain)\
**Post date:** [July 15, 2010, 1:47pm UTC](https://www.ruby-forum.com/t/how-can-i-hide-controller-and-action-name-in-url/191608/2 "2010-07-15T13:47:02Z")

</div>

> [http://localhost:3000/amit123](http://localhost:3000/amit123)
> 
> remove controller(trigger) and action(index) name from url.

> **[Rails Routing from the Outside In — Ruby on Rails Guides](https://guides.rubyonrails.org/routing.html)**
>
> Rails Routing from the Outside InThis guide covers the user-facing features of Rails routing.After reading this guide, you will know: How to interpret the code in config/routes.rb. How to construct your own routes, using either the preferred...

If you look at section 2.3 of that document, it shows how to map  
‘/login’ to  
what would be ‘/sessions/new’.

Cheers,

Andy
