Rails has the handy controller method send_file which lets us download files easily. We can decide whether the file...

makandra Curriculum

Authentication is all about being able to verify the identity of a user in the context of our application.

We have often felt the pain where our models need to serve too many masters. E.g. we are adding a...

Building application assets with esbuild is the new way to do it, and it's great, especially in combination with...

makandra dev

The information in this card is only relevant for Rails 2.3-era apps. This note gives a quick introduction into...

You are not using javascript tests The file is served from a public folder (not via controller) Problem description...

Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']) or a hash (:conditions => { 'state' => 'draft...

...Kubernetes untersuchst. Dabei wird primär auf Scheduling Probleme von Pods eingegangen. Komplexe Probleme mit Controllern oder API Probleme bleiben außen vor, da dies den Rahmen sprengen würde.

When a controller action redirects to an external URL (like http://somehost.com/some/path) you will find that this is hard...

This will show you how to create a RSS feed that the Feed Validator considers valid. Note that RSS is...

api.rubyonrails.org

Rails 5 (don't know about the others) comes with an initializer wrap_parameters.rb. Here you can tell rails to wrap...

:plain window.addEventListener('load', () => { ... }); CSP mit Rails Demo Konfiguration via config/initializer/content_security_policy.rb Überschreiben in einzelnen Controllern Nonce-Support für javascript_tag Probleme mit CSP Fehlkonfiguration Quiz: Wo ist das Problem?

...it does itself. Like that: describe 'before update' do it 'should do something' do controller.should_receive :do_something controller.send :before, :update end

Rails' params hash contains any request parameters (URL parameters or request payload) as well as routing parameters like :controller, :action...

You won't usually have to do this. It's OK to route all formats to a controller, and let...

If in your application your users pass along params that result in filenames, like invoices/generated?number=123. This could be...

If you want to expand your Areca Raid by swapping out the disks for larger ones you will need to...

Don't write resources :people, :concerns => :trashable Write resources :people do concerns :trashable end Why Writing a controller...

github.com

You know that Devise offers RSpec test helpers for controller specs. However, in request specs, they will not work.

makandra dev

This is a visualization of the files that will be generated by some useful rails generators. Invoke a generator from...

Even when you're using bundler, it might be significant in which order your gems are listed in your Gemfile...

In a Rails application, *_spec.rb files get special treatment depending on the file's directory. E.g. when you put a...

blog.plataformatec.com.br

It is common in Rails 3.0 applications that you want to provide default views for a group of controllers. Let...

makandra dev

When a Rails controller action should handle both HTML and JSON responses, do not use request.xhr? to decide that. Use...