#------- put user input (moments) to database moments ---------#
elsif body.start_with? ("record_")
message = "Great! Your moment has been saved. If you want to add tags to your moment, list your tags starting with 'tags_'. Otherwise, I will talk to you tomorrow."
moment = Moment.new( :body => body, user_id: session["current_user"].id )
moment.date_sent = DateTime.now.to_date
moment.save
#------- put user input (moments) to database moments ---------#
#------- adding tags to the last recorded moments ---------#
elsif body.start_with? ("tags_")
moment = Moment.where( user_id: session["current_user"].id).last
moment.tags = body
moment.save
message = "I've updated your moment with those tags 👍"
#------- adding tags to the last recorded moments ---------#
Click to Expand
Content Rating
Is this a good/useful/informative piece of content to include in the project? Have your say!
You must login before you can post a comment. .