Frederick Cheung wrote in post #980025: > On Feb 7, 8:17am, Mohnish G j <[email protected]> wrote: >> [POST] >> 'defg8', 'abcd8', '2011-02-07 13:39:33', NULL) >> SQL (0.001896) COMMIT >> Redirected tohttp://localhost:3000/books/1054583410 >> Completed in 0.01805 (55 reqs/sec) | DB: 0.00376 (20%) | 302 Found >> [http://localhost/books] >> >> I had a question, is it because that the calendar_date_select plugin >> takes the date in the format "Month dd, year" and not as of the standard >> attributes like created_at which take "year-month-date", there is a null >> being inserted for publishing_date while creating a new books record? >> > It's because the publishing_date parameter is being sent at the top > level (ie params[:publishing_date], much as if you'd written > text_field_tag 'publishing_date'. > Either change the name to 'book[publishing_date]' or I seem to recall > there is another form of the helper (analogous to text_field) that > does that for you > > Fred
Hi Fred, Good idea:), I didn think of it.. but.. I am able to now get publishing_date in my parameters for book by using 'book[publishing_date]'. But while inserting it inserts a null value still. I figured another way to tackle my issue which worked, In the controller of books , I gave @book.publishing_date = params[:publishing_date], this would take the publishing_date at the top level and assign it wrt a particular book in the controller create action/method. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

