Skip to content

Instantly share code, notes, and snippets.

@apotonick
Last active March 7, 2018 15:08
Show Gist options
  • Save apotonick/b5b40004e698f1ee8f77d8caebba2858 to your computer and use it in GitHub Desktop.
Save apotonick/b5b40004e698f1ee8f77d8caebba2858 to your computer and use it in GitHub Desktop.
The ever-growing list of bullshit in Rails

Generally speaking, Rails core resists to change its fundamentally flawed architecture. Instead of adding new abstractions, such as form objects, they basically add conditional :if everywhere as a work-around. This document discusses the solutions.

ApplicationRenderer.render

DoubleRenderError

Validation contexts

strong_parameters

accepts_nested_attributes_for

ActiveRecord.suppress

@apotonick
Copy link
Author

Wicked render
Cell render (should be up!)
ApplicationController render

@igor-alexandrov
Copy link

Rails 5 made all belongs_to association required by default. This is total bullshit especially when upgrading from Rails 4.2.
To disable this add

config.active_record.belongs_to_required_by_default = false

to your config.

@igor-alexandrov
Copy link

To completely disable strong parameters in Rails when you are using form objects add

config.action_controller.permit_all_parameters = true

to your config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment