Rails6 I want to make an array of values with a check box

** Get the value with the check box of the form checked and make it into an array. ** **

ActionController::Parameters {"authenticity_token"=>"DoVsq/+dLxgEzm0kXJUo4SWmHx5CBR1GmeV+yNaAeYcDmyMg8nWcMDNSWeMY**************==", "hogehoge"=><ActionController::Parameters {"aaa"=>"0", "bbb"=>"1", "ccc"=>"1", "ddd"=>"1",} permitted: false>, "commit"=>"Search", "controller"=>"distributions", "action"=>"search"} permitted: false>

** Because the form comes like this **

params[:hogehoge].permit!.select { |key, value| value == "1" }.keys
["bbb","ccc", "ddd"]

I got it as **. ** **

Recommended Posts

Rails6 I want to make an array of values with a check box
I want to convert an array to Active Record Relation with Rails
I want to ForEach an array with a Lambda expression in Java
I want to push an app made with Rails 6 to GitHub
I want to make a specific model of ActiveRecord ReadOnly
I want to make a list with kotlin and java!
I want to make a function with kotlin and java!
[Ruby] I want to make an array from a character string with the split method. And vice versa.
I want to make a button with a line break with link_to [Note]
I want to add a browsing function with ruby on rails
I want to make an ios.android app
[Ruby] I want to put an array in a variable. I want to convert to an array
I tried to make a group function (bulletin board) with Rails
[Rails] I want to send data of different models in a form
I want to play with Firestore from Rails
[Rails] I want to load CSS with webpacker
I want to be able to read a file using refile with administrate [rails6]
I want to call a method of another class
How can I efficiently fill an array with values?
I want to use a little icon in Rails
I want to monitor a specific file with WatchService
I want to authenticate users to Rails with Devise + OmniAuth
I want to define a function in Rails Console
[Ruby] I want to make a program that displays today's day of the week!
I tried to make a message function of Rails Tutorial extension (Part 1): Create a model
[Rails] I want to display the link destination of link_to in a separate tab
I tried to make an introduction to PHP + MySQL with Docker
[Java] I want to convert a byte array to a hexadecimal number
Learning Ruby with AtCoder 13 How to make a two-dimensional array
I tried using Hotwire to make Rails 6.1 scaffold a SPA
I want to create a form to select the [Rails] category
A series of steps to create portfolio deliverables with Rails
Even in Java, I want to output true with a == 1 && a == 2 && a == 3
I want to manually send an authorization email with Devise
I tried to make a client of RESAS-API in Java
I tried to make a reply function of Rails Tutorial extension (Part 3): Corrected a misunderstanding of specifications
After posting an article with Rails Simple Calendar, I want to reflect it in the calendar.
I want to write a loop that references an index with Java 8's Stream API
I tried to make a message function of Rails Tutorial extension (Part 2): Create a screen to display
How to make a Java array
A story of connecting to a CentOS 8 server with an old Ansible
The story of toString () starting with passing an array to System.out.println
Cast an array of Strings to a List of Integers in Java
I tried to make an Android application with MVC now (Java)
I tried to check the operation of gRPC server with grpcurl
[Rails] I want to add data to Params when transitioning with link_to
I want to extract between character strings with a regular expression
I tried to make a machine learning application with Dash (+ Docker) part2 ~ Basic way of writing Dash ~
I want to develop a web application!
I tried to make a parent class of a value object in Ruby
I want to write a nice build.gradle
I want to display images with REST Controller of Java and Spring!
I tried to make an automatic backup with pleasanter + PostgreSQL + SSL + docker
I made an app to scribble with PencilKit on a PDF file
[Java] How to turn a two-dimensional array with an extended for statement
I want to use DBViewer with Eclipse 2018-12! !!
I tried to make a machine learning application with Dash (+ Docker) part1 ~ Environment construction and operation check ~
Even in Java, I want to output true with a == 1 && a == 2 && a == 3 (PowerMockito edition)
[iOS] I tried to make a processing application like Instagram with Swift
I want to write a unit test!
I tried to make a Web API that connects to DB with Quarkus