2
I have the following in the controller on Ruby on Rails:
def index
@categorias = Categoria.find(:all)
end
In my View I have the following code to get the categories:
<script type="text/javascript">
var teste = <%= @categorias %>;
alert(teste.length);
</script>
In this case nothing is returned. Can anyone help me?
It shines a lot! Thank you very beast! Pity that has no way to give medal here...
– Jedaias Rodrigues