Undefined local variable or method "rendering_options" error for - forms

I am a beginner and I have used this fix (https://medium.com/#nejdetkadir/how-to-use-devise-gem-with-ruby-on-rails-7-33b89f9a9c13) for making devise work with turbo forms in my previous project and it worked fine. But when I use it in my new project it gives me an
undefined local variable or method rendering_options' for #<TurboDeviseController::Responder:0x00007f9684019cb8 #controller=#<Devise::RegistrationsController:0x0000000000bbd0>, #request=#<ActionDispatch::Request POST "http://localhost:3000/users" for ::1>, #format=:turbo_stream, #resource=#<User id: nil, email: "", created_at: nil, updated_at: nil>, #resources=[#<User id: nil, email: "", created_at: nil, updated_at: nil>], #options={}, #action=:new, #default_response=nil>
error when I sign-up without filling any fields(or passing invalid info in any of the form fields). My previous project seems to be working just fine and I have recreated this error three separate times just to be sure.
For reference here are my:
devise controller file: https://pastebin.pl/view/d275fa93
devise rb file: https://pastebin.pl/view/1b80a0bb
console output : https://pastebin.pl/view/abee4b18
screenshots of error: https://paste.pics/49220ee8d4a60bd874f539e689b32c07, https://paste.pics/286c88869865db2e996ce039a3d5eac3

I was also struggling with this exact problem when I stumbled upon this article written in Japanese: https://qiita.com/gazayas/items/0726f9ffa093e4e2d772
Changing
render rendering_options.merge(formats: :html, status: :unprocessable_entity)
to
render error_rendering_options.merge(formats: :html, status: :unprocessable_entity)
fixed the problem for me. Apparently it is caused by responders updating to 3.1.0.

Related

'YAML syntax error: (): did not find expected key while parsing a block mapping at line 1 column 1' while creating a GitHub issue form

I get the error YAML syntax error: (): did not find expected key while parsing a block mapping at line 1 column 1 while I've created another GitHub issue form.
Here is my code:
name: Bug report
description: Send a bug WinUEFI has that needs to be fixed
title: "[BUG] <title>"
labels: [bug]
body:
- type: markdown
attributes:
value: |
Thank you for filling out a bug that WinUEFI has! It helps me make the application better. Please be as detailed as possible so that i may consider and review the bug easier.
I ask that you search all the issues to avoid a duplicate bug. If one exists, please reply if you have anything to add to it.
Before requesting a bug, please make sure you are using the latest version and that the bug you are requesting is not already fixed in WinUEFI.
- type: textarea
id: bug-and-suggestion-relation
attributes:
label: Is your bug related to a suggestion?
description: Please give some context for this request. Why do you want it to be fixed?
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is and what needs to be fixed.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: List any alternatives you might have tried to fix the bug you want.
- type: checkboxes
id: agreements
attributes:
label: Agreements
description: Please agree to the following:
options:
- label: I have searched for and ensured there isn't already an open issue regarding this.
required: true
- label: I have ensured the bug I'm reporting isn't already fixed in the latest supported WinUEFI build.
required: true
- type: textarea
id: other
attributes:
label: Other
description: Add any other context or screenshots about the feature request below.
EDIT: I have fixed it by correcting an another few things.
I've tried changing the name value, but it did not help.
I expected it to parse correctly and work as a template.
You have several issues going on with your YAML. First, labels: [bug] should be labels: ["but"] as that accepts a string array.
Second, you have a lot of issues with spacing. Remember that YAML is highly sensitive to spacing. Here is the working YAML of what you are looking for:
name: Bug report
description: Send a bug WinUEFI has that needs to be fixed
title: "[BUG] <title>"
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thank you for filling out a bug that WinUEFI has! It helps me make the application better. Please be as detailed as possible so that i may consider and review the bug easier.
I ask that you search all the issues to avoid a duplicate bug. If one exists, please reply if you have anything to add to it.
Before requesting a bug, please make sure you are using the latest version and that the bug you are requesting is not already fixed in WinUEFI.
- type: textarea
id: bug-and-suggestion-relation
attributes:
label: Is your bug related to a suggestion?
description: Please give some context for this request. Why do you want it to be fixed?
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is and what needs to be fixed.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Describe alternatives you've considered
description: List any alternatives you might have tried to fix the bug you want.
- type: checkboxes
id: agreements
attributes:
label: Agreements
description: "Please agree to the following:"
options:
- label: I have searched for and ensured there isn't already an open issue regarding this.
required: true
- label: I have ensured the bug I'm reporting isn't already fixed in the latest supported WinUEFI build.
required: true
- type: textarea
id: other
attributes:
label: Other
description: Add any other context or screenshots about the feature request below.

Kotlin changes parameter names to alphabetical values on release for a Flutter app

I recently started running into an issue, where, when building my Flutter in release mode to deploy to Play Console's internal testing track, some of my functions in Flutter started failing.
For context, I have EventChannels that stream data from a native function to Flutter, from which I construct a Flutter object.
After countless hours of investigation, it turned out that, in debug mode, the JSON string I'm constructing in Kotlin, contains the correct keys, however, when doing the same thing in release, the keys turn to a:, b:, c:, etc.
At this point in time, I've got no obfuscation enabled in the app, and I'm not too sure why this would have suddenly broke.
I can't cater for the actual names, and alphabetical values in my toJson() function on my class, so want to know how, in release, can I get my parameter values back?
The kotlin class that's encoded to JSON looks like this:
class ScanResponseModel(var name: String, var mac: String, var axis: String, var number : String)
The json output for this, in DEBUG, looks like this:
[{
"name":"2325",
"mac":"D4:1C:32:33:EE:1F",
"axis":"left",
"number":"0002325"
}, {
"name":"2122",
"mac":"DC:20:3F:E7:05:B7",
"axis":"right",
"number":"0002122"
}]
The exact same output in RELEASE, looks like this:
[{
"a":"2325",
"b":"D4:1C:32:33:EE:1F",
"c":"left",
"d":"0002325"
},
{
"a":"2122",
"b":"DC:20:3F:E7:05:B7",
"c":"right",
"d":"0002122"
}]

Grails mongodb plugin configuration

I use grails 2.5 and setup mongodb plugin. And there is the problem: when I try to save next object using console - all is ok, and empty strings saving as empty strings:
User {
name: "Hary",
lastname: ""
}
But when I try to save the same object via Idea using plugin listed above, it returns next:
User {
name: "Hary",
lastname: null
}
I understand, that mongodb plugin can converts empty strings to null, but I can't find solution for this problem.
Anyone know how can I solve it? Thanks!

Issue with using polymorphic_path with FactoryGirl build object

I am using factory_girl and rspec2 for my testing. I have an issue with the following code:
let(:book) { build(:book, id: 1) }
book_path(book)
book_path statement is generating /books url instead of /books/1. I can use create, but any suggestions on how to fix this using build strategy?
I am using
rspec-rails (2.11.0)
factory_girl (3.5.0)
Try book.to_param (that's actually what book_path(book) is doing under the hood) and see what it returns. By default to_param returns id, but your book is not saved yet, so it can return nil.

Unclear Mongoose error

I get the following error:
TypeError: Cannot read property 'name' of undefined
at new SchemaArray (/home/campaigns/scheduler/tests/node_modules/mongoose/lib/schema/array.js:40:22)
at Function.interpretAsType (/home/campaigns/scheduler/tests/node_modules/mongoose/lib/schema.js:201:12)
at Schema.path (/home/campaigns/scheduler/tests/node_modules/mongoose/lib/schema.js:162:29)
at Schema.add (/home/campaigns/scheduler/tests/node_modules/mongoose/lib/schema.js:110:12)
at Schema.add (/home/campaigns/scheduler/tests/node_modules/mongoose/lib/schema.js:106:14)
at new Schema (/home/campaigns/scheduler/tests/node_modules/mongoose/lib/schema.js:38:10)
at Object. (/home/campaigns/scheduler/tests/testSchedulerModel.coffee:12:21)
at Object. (/home/campaigns/scheduler/tests/testSchedulerModel.coffee:177:4)
at Module._compile (module.js:402:26)
at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script.js:57:25)
However, on line 12 of testSchedulerModel.coffee there is no reference to 'name'. Here is what line 12 looks like:
ObjectId = Schema.ObjectId
So how should I understand this error?
Thank you,
Igor
Sigh. Unfortunately, while you'd think testSchedulerModel.coffee:12 would mean "line 12 of testSchedulerModel.coffee, it actually means "line 12 of the JavaScript that testSchedulerModel.coffee is compiled to. The problem is that there's currently no way to trace errors back to the original CoffeeScript (at least not under Node).
So, you'll have to compile testSchedulerModel.coffee as JS and see what line 12 is there.
Better debugging tools for CoffeeScript are coming, but for now, it's probably best that you set up a Cakefile that compiles your code to JS before running it, to avoid such confusion.
By the way, there is an open issue regarding those .coffee filenames in the stack trace: issue 987.
Trevor: Kudos for the tip!
I solved my issue. It turns out that I cannot have objects inside of arrays when defining my schema in Mongoose. I was doing it like this:
AdUnitSchema = new mongoose.Schema
venue: [
{
id: ObjectId,
name: String
}
],
geotarget: [
{
id: ObjectId,
name: String
}
]
But in actuality, I had to create separate schemas, and reference them like this:
AdUnitSchema = new mongoose.Schema
venue:
[VenueSchema]
geotarget:
[GeotargetSchema]