Forum: Ruby on Rails Trouble posting data to database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fb663cdf19f6a5820a564ae40558c6cf?d=identicon&s=25 Ian Baraza Brayoni (Guest)
on 2014-08-04 08:03
(Received via mailing list)
Hi guys,

Am trying to submit data through a text_area loaded by a partial form
unsuccessfully thus far.

Please find my code here
<https://gist.github.com/Brayoni/1e3476ee672479dc971c>.

Any leads highly appreciated.

Thank you.
46a0becb1faafdd991788635ffad0550?d=identicon&s=25 Marco Antonio Almeida (Guest)
on 2014-08-04 09:29
(Received via mailing list)
Hi Ian,

Check out line 20 of you StudentIndisciplinesController
<https://gist.github.com/Brayoni/1e3476ee672479dc97...
. You're passing a parameter that is nil according to your log. Also, if
you want to have more than one student indiscipline being saved you will
need to .save inside the .each loop. You're also unable to save because
of
the validation error thrown, since you're instantiating the object
without
a case.

Also, I would suggest that you do the things at your controller more
restful. Your students action it looks like a create action and your
list a
index action, unless you have a good reason to do how you're doing.

Hope this helps.

Best regards,

*Marco Antonio Almeida*+45 31 65 28 84
Twitter: @marcoafilho <http://www.twitter.com/marcoafilho> | LinkedIn:
marco-antonio-almeida-filho
<http://www.linkedin.com/pub/marco-antonio-almeida-...


On Mon, Aug 4, 2014 at 6:43 AM, Ian Baraza Brayoni
<ibaraza.ib@gmail.com>
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2014-08-04 21:58
(Received via mailing list)
On 4 August 2014 08:28, Marco Antonio Almeida <marcoafilho@gmail.com>
wrote:
> index action, unless you have a good reason to do how you're doing.
Also you might find it beneficial to work right through a good
tutorial such as railstutorial.org (which is free to use online) as
that will show you the basics of Rails.

Colin
This topic is locked and can not be replied to.