If a controller action responds to other formats than HTML (XML, PDF, Excel, JSON, ...), you can reach that code in...

...your Firefox versions because your Selenium tests break whenever Firefox updates, there is a better way that lets you keep an up-to-date Firefox. Mozilla has stated that they...

...data is guaranteed. There are however cases where you want to improve the user behavior (Rails error box) or reduce the number of exceptions e-mailed to your / collected by...

...values, which map to one context, e. g. mail components, in order to provide better readability of your tests or to even make clear a tests fail reason due to...

So you have a heading that is just barely wider than the container it should fit into, and it wraps...

makandra dev

This is about converting Haml to ERB and not the other way round which you probably want! This process can...

Debugging performance issues in your Rails app can be a tough challenge. To get more detailed insights consider using the...

...with the desired metric from Ollama's response: # app/util/ollama.rb ActiveSupport::Notifications.instrument('request.ollama') do |payload| begin response = HTTP.post('https://my-ollama-instance.com/api/chat', json: body) if response.status.success? parsed = response.parse payload[:input_tokens] = parsed...

If you're still working on ruby 1.8, you should know that using SimpleDelegator is often prohibitively slow. I have...

Consul 0.6.1+ gives your Power class a number of static methods that behave neutrally in case Power.current is nil. This allows you to create authorization-aware models that still work...

...user.email, user.income] end end end There is a long selection of class methods that behave neutrally in case Power.current is nil: Call Equivalent Power.for_model(Note) Power.current.present? ? Power.current.notes : Note

...can be useful to model a period without an actual end or an actual beginning. Imagine someone taking holidays and booking a holiday without knowing the end yet. Or providing...

web.archive.org

This note shows how to merge an ugly feature branch with multiple dirty WIP commits back into the master as...

relishapp.com

Sometimes you have a test expectation but actually want a better error message in case of a failure. Here is how to do that. Background Consider this test: expect(User.last...

Why is this cool? One might argue why we would want to have better error messages for test expectations when our tests are supposed to be always passing. Well...

Cards can now be flagged as "Repeating". Every Wednesday, some of these cards will be moved back to the top...

You may remember to use the || operator with caution to set defaults. We'll see that && and other conditionals come...

alanklement.blogspot.de

...written about the problem with user stories before. At the time, I found it better to just have the team talk over proposed changes to the product. This worked great...

Once Rails knows a given string is html_safe, it will never escape it. However, there may be times when...

makandra dev
gist.github.com

...byebug commands, it comes in handy with it's features for many use cases beyond that to make your life easier. For this cheatsheat I tried to structure the most...

...instance_methods(false). method -- The same as running .methods. Commands to change (or add) behavior at breakpoints display / undisplay [ ] - display or undisplays an expression at stopped breakpoint enable / disable [id...

This card existed before, but was outdated due to browser implementation changes. The information below is validated for the current...

...if .second-item could be rendered smaller without problems or has because you defined behavior for it. +---------+--------------------------------------+ | | - 1000 characters looooooooooooong | | +---------+--------------------------------------+ Try it on CodePen. There are two ways to fix...

...may just set overflow: hidden or maybe on .second-item and/or add some overflow behavior and you're done. In some cases, this might not be the solution because the...

...tells rails how to build the path correctly is a single slash at the beginning of the path: <%= javascript_include_tag('ckeditor/config') %> # for assets/ckeditor/config.js <%= javascript_include_tag('/ckeditor/ckeditor') %> # for public/ckeditor/ckeditor.js...

github.com

For Sidekiq to be able to retry your jobs it has to be able to catch errors that occur while...

stackoverflow.com

From Rails 3.0.9, there is a method Hash#to_query that will turn a Hash into a query string:

...Rails code is doing the delivery you can do your usual authentication and authorization beforehand. There are few exceptions where you want to store confidential files in the public folder...