Skip to content

Refine strong params #35

Description

@nyarly

CUrrent strong_params look like: params[:thing].permit(...)

Should at least be params.require(:thing).permit(...)

I've been liking

def thing_params
  params.require(:thing)
end

def thing_attrs
  thing_params.permit(...)
end

This lets synthetic and transient params to be used more easily without getting into attrs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions