E
E
eldar_web2015-08-29 14:47:42
Ruby on Rails
eldar_web, 2015-08-29 14:47:42

How to set two identical parameters in url in Rails?

There is, for example, the url of the view: site.ru?type=23&type=77
So, how to take these parameters and process them in the view???
I tried this: it doesn't work.
params[:type].each do |t| ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
eldar_web, 2015-08-29
@eldar_web

Found a solution. You just need to write [] after the parameters, i.e. like this:
site.ru?type[]=23&type[]=77

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question