Question: when accessing a website, you are asked to wait 10 minutes for example in order to make another request, suppose you are using a router as a mean to access internet (192.168.xxx.xxx), with "renewing" just the local ip address would the 10 minutes be skipped or the address given to the router is the one that should be changed?

Answer: 
I believe if you have a javascript file with the extension `.js.erb` or `.js.coffee.erb`, all the extensions would be parsed from right to left, thus your code should understand some `erb` tags inside it, before parsing the `coffeescript` and ultimately the `js` part.
I'm not sure why you would want to use the controller name when DEFINING your function, but if you really do, then 

* change your JS file from a .js extension to .js.erb
* rename the file to match the correct route/action (i.e. create, update, destroy, et...) that it should respond to
* place it in your view folder
* modify/use:
-link\_to
-button\_to
-form\_tag
-form\_for
with the `remote: true` attribute: e.g.  

**`<%= form_for(@article, remote: true) do |f| %>`**

Find more information: 

	1. here: <http://edgeguides.rubyonrails.org/working_with_javascript_in_rails.html>
	2. and here: <http://www.alfajango.com/blog/rails-3-remote-links-and-forms-data-type-with-jquery/>

**ALTERNATIVELY,** 

You could predefine functions statically for each controller, e.g.:

```
  function Users(param1, param3...){
    ....   
  }
  function Friends(param1, param3...){
    ....   
  }
  function Likes(param1, param3...){
    ....   
  }
  function Posts(param1, param3...){
    ....   
  }

```

then add an additional JavaScript statement to launch the appropriate function depending on which controller is being called, e.g.:

```
  <%= controller_name %>();

```