I'm new to Rails. If anyone could help me convert this code into a ruby link\_to method:

```
<a href="#top" onclick=$("#menu-close").click();>Home</a>

```

I tried to search google for an answer. But it made me more confuse on how to implement it on my site.

```
<%= link_to "Home" , {:action => "index", :controller => "welcome", :anchor => "top", :onclick => '$("#menu-close").click()' } %> 

```

but still it does not close the sidebar. 

Here is also the script I put below the footer : 

```
$("#menu-close").click(function(e) { 
  e.preventDefault(); 
  $("#sidebar-wrapper").toggleClass("active"); 
});

```