How to set a js var in from a rails controller?
===

I have 2 controllers and a single view and I need the view to change depending on my controller. What I have in mind is to have a JS var in my view that I can set depending on which controller was called.

To be a bit more thorough on my explanation, I need to get a string value set inside a var so I can use it like this (in my JS):

    if (value_i_set_in_controller == "controller1") {
       // do something
    } else {
       // do something else
    }

Any hints? Until know I have been finding Rails pretty easy.

