1 of 1 people found this helpful
Looks like you are trying to call controller method.
When this ruby line executed (<%= url_for :controller => :Views, :action => :enable_scanner %>), it will give you html output like /app/Views/enable_scanner, which is a link to controller call.
So to call a ruby method on body onload ,
1: Create a js method which will do ajax call to controller method i.e enable_scanner
2: Call that js method onload.