○ Unclear points
Creating a new submission form.
This form contains a text box for the subject, a text area for the body and submit
There are button controls.
If i enter the subject and body and send it, the process to save it in the DB is included.
For some reason only the subject is not saved.
When new data is created from the console, both the subject and body are saved in the DB.
Will be done.
I don't understand why only the subject is not registered.
Could someone please tell me the cause?
○ Source code
Post a question
<% = form_tag ("/ questions/create", method:: "post") do%>
Controller (Nothing has been written for other actions yet. Only the device.)
@ question = Question.new (subject: params [: subject],
body: params [: body])
redirect_to ("/ questions/index")
○ DB confirmation (partial excerpt)
ID | Subject | Body |
1 | test | test |
2 | subject | body |
3 | subject | body |
4 | subject | body |
5 || From Form |
6 | test | test2 |
7 || Will it work from the form |
8 | test | test2 |
IDs 5 and 7 are creating data from the form.
The subject is not saved in the DB.
rails Rails 220.127.116.11
SQLite version 3.33.0
Answer # 1
<input type = "text", name = "subject">
Between type and name of
,Is unnecessary. Separate with spaces
- ruby on rails - data cannot be saved in the intermediate table (parameters cannot be passed)
- ruby on rails - date_select cannot be saved
- ruby on rails - image cannot be saved (activestorage installed) null in image of table
- ruby on rails - i want to create an image posting function with react (typescript), formik, rails api, activestorage
- ruby on rails - i want to display the latest posting date and time by creating a simple bulletin board
- ruby - not saved with rails new save method
- ruby on rails - comment posting function actioncontroller :: urlgenerationerror
- ruby - [rails] i want to save only check items in the db
- ruby on rails - i cannot save a comment on the comment posting page
- ruby on rails - creating an image posting application where the data entered in the form is not saved
- ruby on rails - i implemented it so that images can be saved in s3 of aws, but the view can no longer be displayed
- ruby on rails - rails associated model is not saved in db
- ruby on rails - the image cannot be saved in s3 and cannot be displayed in the view aws :: sigv4 :: errors :: missingcredentials
- ruby on rails - s3 images are not saved on the ec2 server
- ruby on rails - it is not saved in the database after registering the product
- ruby on rails - not saved by create action
- ruby on rails - [rails] i want to get the data of the dropdown selection items
- ruby on rails - about image posting page argumenterror
- ruby on rails - saved description in nested controller
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- [php] i want to get account information using coincheck api
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to call a child component method from a parent in vuejs
- i want to check the type of a shell script variable