All threads / How update value which run from strong params??
Ask A Question


You’re not receiving notifications from this thread.

How update value which run from strong params??

Taras asked in General

I have action(strong parameters) in controller:

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

i want do something similar to this

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

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

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 68,099+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.