I've trying to build a home.js.erb file to match my controller action home.html.erb
I built it, and made a simple alert call in the js but it doesn't show. When I copy/paste to another of my methods, the alert works.
I want js to work with my home action
The flow is: signin (via Facebook) => go home. No button calls the action "Home" because I use Facebook login, which runs via redirect on Javascript after FB logs the user in.
Here is the home action:
def home
respond_to do |format|
format.html
format.js
end
end
And here is the home.js.erb:
$(function(){
alert("Hello");
});
And finally the routing around the controller, which is called session:
resources :session
match '/signin', :to => "session#signin"
match '/home', :to => "session#home"
match '/logout', :to => "session#logout"
match '/register', :to => "session#register"
Any help would be appreciated!