Skip to content
Archive of posts filed under the Ruby on Rails category.

Hidden fields in rails (or: sometimes rails sucks)

Well, in general, ruby on rails is a powerful tool for developing web applications. But sometimes it really sucks, because of inconsistencies in the API. I tried to add a hidden field to a form_for. A hidden field for form_tag works like: So for form_for forms, I expect (similar to text_field etc.): But this solution [...]

Expensive function calls

I know, function calls are not ‘for free’ concerning runtime. This week I discovered that they can be quite expensive. I started with something like the following: Model “BigCollection” implements something like def test_something   big_collection.each do |small_collection|     small_collection.test_something Model “SmallCollection” implements something like def test_something   small_collection.each do |item|     item.test_something And the controller did inputfile.each do [...]