Question: I need to create route `/branch` which run script `/lib/branch.rb`, I need to display only one string which displayed in browser my current git branch which deployed at staging server. I already write script, but cant understand how to mount it to rails routes

Answer: 
Try the following solutions by Directly targeting the `ul` 

***Solution A***:

---

```js
//  previous (following) is very inefficient and slow:
//   -- $(this).find("ul.sub-menu").not("ul.sub-menu li ul.sub-menu").slideDown(); 
//  Rather, target the exact ULs which are Direct Children

$("ul.menu").find('li').hover(
    function() {
        $(this).find('> ul').slideDown();
    },
    function() {
        $(this).find('> ul').slideUp();
        //  If something Slides Down, it should slide up as well,
        //  instead of plain hide(), your choice - :)
    }
);

```

***Solution B***: 

---

for more Precision over both ULs 

**Update**: Solution A works fine and makes B redundant 

```
$("ul.menu").find('> li').hover(
    function() {
        $(this).find('> ul').slideDown();
    },
    function() {
        $(this).find('> ul').hide();
    }
);

$("ul.sub-menu").find('> li').hover(
    function() {
        $(this).find('> ul').slideDown();
    },
    function() {
        $(this).find('> ul').hide();
    }
);

```

Check the **[Fiddle](http://jsfiddle.net/OMS_/XDkXq/)**
This is untested .. and you have to expand it a bit.

```
$('ul.menu li').siblings('ul:first-child').on('click', function() {
if($(this).is(':visible')) {
    $(this).hide();
}
else {
    $(this).show(); 
}
})

$('ul.menu li').siblings('ul:first-child').hover(
function() {
    $(this).show();
},
function() {
    $(this).hide();
}
)

```

Edit: As I see your structure is inconsistent. Sometimes you place a list IN a li element, sometimes it is placed as a sibling...