
jefff
Agile Web Development with Rails 7: unpermitted parameter error (page 199)
I’ve been struggling to get the active_job to work and after hitting a wall I resorted to using the book’s latest source code and I’m still getting an error when I submit my order. Here’s the console:
14:40:27 web.1 | ↳ app/controllers/orders_controller.rb:40:in `block in create'
14:40:27 web.1 | Unpermitted parameters: :routing_number, :account_number. Context: { controller: OrdersController, action: create, request: #<ActionDispatch::Request:0x000000010bb5cf00>, params: {"authenticity_token"=>"[FILTERED]", "order"=>{"name"=>"this is my name", "address"=>"this is my address", "email"=>"test@example.org", "pay_type"=>"Check", "routing_number"=>"123", "account_number"=>"456789"}, "commit"=>"Place Order", "controller"=>"orders", "action"=>"create"} }
14:40:27 web.1 | Unpermitted parameters: :routing_number, :account_number. Context: { controller: OrdersController, action: create, request: #<ActionDispatch::Request:0x000000010bb5cf00>, params: {"authenticity_token"=>"[FILTERED]", "order"=>{"name"=>"this is my name", "address"=>"this is my address", "email"=>"test@example.org", "pay_type"=>"Check", "routing_number"=>"123", "account_number"=>"456789"}, "commit"=>"Place Order", "controller"=>"orders", "action"=>"create"} }
14:40:27 web.1 | Unpermitted parameters: :name, :address, :email, :pay_type. Context: { controller: OrdersController, action: create, request: #<ActionDispatch::Request:0x000000010bb5cf00>, params: {"authenticity_token"=>"[FILTERED]", "order"=>{"name"=>"this is my name", "address"=>"this is my address", "email"=>"test@example.org", "pay_type"=>"Check", "routing_number"=>"123", "account_number"=>"456789"}, "commit"=>"Place Order", "controller"=>"orders", "action"=>"create"} }
Same error if I run my code or I run the book’s source.
Marked As Solved

rubys
Author of Agile Web Development With Rails
Very observant! This is actually from the previous edition, and to the best of my knowledge nobody else noticed this. The problem actually is in the previous chapter where the new fields were added to the form but not to the database.
You may think this is cheating, but as it doesn’t further any narrative to spell out that code, I’m adding it to the Playtime exercises at the end of chapter 12. It simply is a matter of creating a migration and adding the fields to order_params
.
Popular Prag Prog topics

As per the title, thanks.
New

page 37
ANTLRInputStream input = new ANTLRInputStream(is);
as of ANTLR 4 .8 should be:
CharStream stream = CharStreams.fromStream(i...
New

your book suggests to use Image.toByteData() to convert image to bytes, however I get the following error: "the getter ‘toByteData’ isn’t...
New

Hi @Margaret ,
On page VII the book tells us the example and snippets will be all using Elixir version 1.11
But on page 3 almost the en...
New

First, the code resources:
Page 237: rumbl_umbrella/apps/rumbl/mix.exs
Note: That this file is missing.
Page 238: rumbl_umbrella/app...
New

@noelrappin
Running the webpack dev server, I receive the following warning:
ERROR in tsconfig.json
TS18003: No inputs were found in c...
New

This is as much a suggestion as a question, as a note for others.
Locally the SGP30 wasn’t available, so I ordered a SGP40. On page 53, ...
New

Hi, I need some help, I’m new to rust and was learning through your book. but I got stuck at the last stage of distribution. Whenever I t...
New

Modern Front-End Development for Rails - application does not start after run bin/setup (page xviii)
After some hassle, I was able to finally run bin/setup, now I have started the rails server but I get this error message right when I vis...
New

Modern front-end development for Rails, second edition - Struggling to get the first chapter to work
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
Other popular topics

If it’s a mechanical keyboard, which switches do you have?
Would you recommend it? Why?
What will your next keyboard be?
Pics always w...
New

Why, if your answer is yes?
New

Here’s our thread for the Keyboardio Atreus. It is a mechanical keyboard based on and a slight update of the original Atreus (Keyboardio ...
New

Thanks to @foxtrottwist’s and @Tomas’s posts in this thread: Poll: Which code editor do you use? I bought Onivim! :nerd_face:
https://on...
New

I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New

Biggest jackpot ever apparently! :upside_down_face:
I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New

Author Spotlight
James Stanier
@jstanier
James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New

Author Spotlight:
David Bryant Copeland
@davetron5000
We’re so happy to bring you another Author Spotlight, a series where we sit dow...
New

Inside our android webview app, we are trying to paste the copied content from another app eg (notes) using navigator.clipboard.readtext ...
New

Author Spotlight:
Karl Stolley
@karlstolley
Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /haskell
- /java
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /scala
- /zig
- /html
- /debian
- /nixos
- /lisp
- /agda
- /textmate
- /sublime-text
- /react-native
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /slackware
- /c
- /julia
- /neovim
- /markdown