ActionController::ParameterMissing (param is missing or the value is empty: film):

I have got this problem too when I use Angular JS form to send data to backend Rails 4. When I did not fill anything in angular js form, the error will show ActionController::ParameterMissing (param is missing or the value is empty:. I fix it by adding params.fetch(:film, {}) the strong parameter into: params.fetch(:film, {}).permit(:name, … Read more

JWT token decoding even when the last character of the signature is changed

The reason is the base64url encoding. The three parts of a JWT are all base64url encoded. Base64 encoding transforms the input data to a 6-Bit representation, mapped to a set of 64 ASCII characters. If you have 3 bytes source data (24 bits), the base64 encoded result is 4 characters long, each character representing a … Read more

Ruby 1.9.2 how to install RMagick on Windows?

I just installed RMagick 2.13.1 successfully on Windows with Ruby v1.9.x ! Let me spill out the procedure, before I forget. Install DevKit : https://github.com/oneclick/rubyinstaller/wiki/Development-Kit . Install ImageMagick 6.6.x with windows installer with headers. NOTE: -Do not install ImageMagick in a path which has spaces in it. The default path C:/Program Files/… will not work. … Read more

Incompatible library version: nokogiri.bundle requires version 11.0.0 or later, but libxml2.2.dylib

I suggest you first uninstall Nokogiri using: sudo gem uninstall nokogiri Then install Nokogiri using rubygems: gem install nokogiri If that doesn’t work, there’s an open issue on Nokogiri to support libxml 2.9.0 and later. There’s a libxml2-2.9.1 branch that was started in preparation for the next release of libxml2. Then try pulling from that … Read more

How to programmatically list all controllers in Rails

In Rails 3.1+: Rails.application.routes This will give you all the controllers, actions and their routes if you have their paths in your routes.rb file. For example: routes= Rails.application.routes.routes.map do |route| {alias: route.name, path: route.path, controller: route.defaults[:controller], action: route.defaults[:action]} end Update: For Rails 3.2, Journal engine path changed, so the code becomes: routes= Rails.application.routes.routes.map do |route| … Read more