Rails updateattributes not updating timestamp jon foster and sophia bush dating
Notice that when :datetime or :timestamp is used, it becomes a timestamp in the database.
This also allows you to create non-table attributes that affect the record.Announcement (2017-05-07): 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.I'm stuck and i don't know why it is not working right. When i update the lesson rails update properly the lesson attributes but is creating another sublessons records instead of just updating it. i have this hidden fields for adding anothers sublessons and it's seems like it's generating some nasty ids..i want to create and update same time i have to make another method i think....i 'm new to this business i'm struggle to learn the conceps...i came from php wordpress and there are diferent stuff Maurius.Here is my code View Form: "lesson_id" validates :sublesson_name, presence: true validates :sublesson_content ,presence: true end lesson controller def update @lesson = Lesson.find(params[:id]) @[email protected] @lesson.update(lesson_params) flash[:notice] = "Lesson updated" redirect_to lessons_show_url else flash[:notice] = "Error" redirect_to lessons_show_url end end def edit @lesson = Lesson.find(params[:id]) @[email protected] def lesson_params params.require(:lesson).permit(:lesson_name, :lesson_icon, sublessons_attributes:[:sublesson_id, :sublesson_name, :sublesson_content, :sublesson_video_link]) end Marius.. You need to add the :id attribute in addition to the other nested attributes. I am not able to understand your second question :) Would be nice if you started a new thread with detailed explanation. view (e.g consider mike is user and its create name,city and address dynamic column how three row inserted into database.
Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms. I've been googling and still havent found out why this is the case.