
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

Many tasks_proj/tests directories exist in chapters 2, 3, 5 that have tests that use the custom markers smoke and get, which are not decl...
New

Title: Hands-On Rust (Chapter 11: prefab)
Just played a couple of amulet-less games. With a bit of debugging, I believe that your can_p...
New

Hi Jamis,
I think there’s an issue with a test on chapter 6. I own the ebook, version P1.0 Feb. 2019.
This test doesn’t pass for me:
...
New

Hi! I know not the intentions behind this narrative when called, on page XI:
mount() |> handle_event() |> render()
but the correc...
New

Hi @venkats,
It has been mentioned in the description of ‘Supervisory Job’ title that 2 things as mentioned below result in the same eff...
New

When trying to run tox in parallel as explained on page 151, I got the following error:
tox: error: argument -p/–parallel: expected one...
New

Is the book’s epub format available to read on Google Play Books?
New

Hey there,
I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “>...
New

Hi all,
currently I wonder how the Tailwind colours work (or don’t work).
For example, in app/views/layouts/application.html.erb I have...
New

Hi, I’m working on the Chapter 8 of the book.
After I add add the point_offset, I’m still able to see acne:
In the image above, I re...
New
Other popular topics

Any thoughts on Svelte?
Svelte is a radical new approach to building user interfaces. Whereas traditional frameworks like React and Vue...
New

A PragProg Hero’s Journey with Brian P. Hogan @bphogan
Have you ever worried that your only legacy will be in the form of legacy...
New

SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New

Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New

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

Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New

Author Spotlight
Mike Riley
@mriley
This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New

Author Spotlight
Erin Dees
@undees
Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New

Author Spotlight:
Karl Stolley
@karlstolley
Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New

I have always used antique keyboards like Cherry MX 1800 or Cherry MX 8100 and almost always have modified the switches in some way, like...
New
Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /v
- /react-native
- /wasm
- /django
- /security
- /nodejs
- /centos
- /rails
- /haskell
- /fable
- /gleam
- /js
- /swift
- /deno
- /assemblyscript
- /tailwind
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /flutter
- /preact
- /c-plus-plus
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /keyboards
- /html
- /vuejs
- /emacs
- /nim
- /nerves
- /elm