I have many different models and I want to reuse the same code for the
So in my helper i have:
button_to t('buttons.delete'), :action => "destroy", :controller
Normally i work with paths a la post_path(item_to_destroy) but I cant
find a way of making that work for different models except throwing in
some stupid switch statement which makes the code REALLY ugly..
So the code above throws a route not found error. BUT:
button_to t('buttons.delete'), :action => "new", :controller =>
works just fine.. these are the things that really annoy me about ruby
Also.. the most ridiculous thing happens at the moment.. I use the
users.js.coffee doesnt get executed in my browser anymore.. If i put
it in example 'messages.js.coffee' it works just fine. EXACTLY the
same syntax in both files.. I have NO idea why that happens. But
frankly after wasting 1h on that I dont care. Just leave my code in
the wrong file where it works..