config.action_controller.action_on_unpermitted_parameters enables logging or raising an exception if parameters that are not explicitly permitted are found. Set to :log or :raise to enable. The default...
...value is :log in development and test environments, and false in all other environments. Rails 3: If you include the strong_params gem, see the Readme for handling unpermitted keys...
This card shows how to get a Ruby method touch_device? for your Rails views and a method TouchDevice.isPresent() for your Javascripts. Note that we are detecting touch devices...
You can significantly improve performance by adding this to config/initializers/better_errors: if defined?(BetterErrors) && Rails.env.development? module BetterErrorsHugeInspectWarning def inspect_value(obj) inspected = obj.inspect if inspected.size > 20_000 inspected = "Object was...
...this on the top of your config/schedule.rb: job_type :runner, "cd :path && bundle exec rails runner -e :environment ':task' :output...
...disable it in tests, by adding a body class for tests %body{'data-environment' => Rails.env} overriding the transforms [data-environment="test"] * text-transform: none !important
...in all needed sizes, formats and with the HTML needed to include them! In Rails applications with Haml: put all the favicon files into /public store the HTML to app/views/layouts/_favicon.html...
If your Rails application is using Webpack you need to serve assets on the same host as you application runs, otherwise you will see the following errors in your browser...
Best results in other decks
Read the Rails Guide about Active Record migrations Understand why we never use models in migrations. Checkout the repository Project Hero and read through some migrations in db/migrate. Find...
...files in the db/migrate folder. Read and understand How to write complex migrations in Rails Discuss with your mentor Instead of migrations, could we simply log into the production server...
An expectation like this will fail with Rails LTS 2.3: should render_template(:edit) The error will look like this: expecting but rendering with <""> This is an issue with rspec...
...rails 1.x monkey-patching into ActionController during controller specs. Fix To fix this, use our compatibility fork of rspec-rails 1.3. If you are using Rails 2.3 LTS with...