I want to send to my controller some data, and then in variables:
- params[:oem_number]
- params[:id]
and see there some data, but how can i send to method data? How to write this route?
Now i have such route:
match '/articles/by_oem/:id&:oem_number' => 'articles#articles_by_oem', :as => :articles_by_oem
And try to create link:
= link_to "аналоги", :articles_by_oem(:id => no.article_nr, :oem_number => no.oem)
But i get SyntaxError errors…
So how to solve my problem? Please don’t send me to rails doc’s…
Just how to create link, that will send this two params, and also before edit route…
first, you don’t need that list of parameters on a route.
You can leave just this in your
routers.rb:And, then, what are you trying to do here?
:articles_by_oemis a symbol, not a function. Usearticles_by_oem_pathmethod instead: