Taras

Joined

50 Experience
0 Lessons Completed
0 Questions Solved

Activity

Posted in How update value which run from strong params??

I have action(strong parameters) in controller:

def home_task_params
     params.require(:home_task).permit(:subject, :description, :data)
end

i want do something similar to this

def create
@home_task = HomeTask.create(:subject => home_task_params.subject, :description => home_task_params.description, :day => home_task_params.data,
 :data => home_task_params.data, :class_room => current_user.class_room )
 end

I need it because I want to modify the data before recording to the database?
How do i implement it???TY

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2021 GoRails, LLC. All rights reserved.