shotleybuilder

shotleybuilder

Protocol Phoenix.Param not implemented for []. This protocol is implemented for: Any, Atom, BitString, Integer, Map

Hi

A curious error has arisen in a previously functional piece of code. I have a route that looks like this:

get "/:type/:year/:number", MyController, :show

I’ve been using this path helper successfully for ages:

<%= link( to: my_path( @conn, :show, type, year, number ) ) do %>

But now it throws the above error. I’ve commented out the line so I know it’s the offending clause. I’ve also upgraded to 1.4 so it now looks like

<%= link( to: Routes.my_path( @conn, :show, type, year, number) ) do %>

Same error.
This will be super simple fix I’m sure …

Marked As Solved

shotleybuilder

shotleybuilder

I’ve rehashed the routes and given them unique defs in the controller. Think it’s fixed!

#Routes.my_path helper
#contents
get "/:type/:year/:number/contents", MyController, :contents
#section
get "/:type/:year/:number/section/:section_number", MyController, :section
#group
get "/:type/:year/:number/group/:group_number", MyController, :group
#part
get "/:type/:year/:number/part/:part_number/chapter/:chapter_number", MyController, :part_chapter
get "/:type/:year/:number/part/:part_number", MyController, :part
#schedule
get "/:type/:year/:number/schedules", MyController, :schedules
get "/:type/:year/:number/schedule/:schedule_number/paragraph/:paragraph_number", MyController, :schedule_paragraph
get "/:type/:year/:number/schedule/:schedule_number", MyController, :schedule
#whole
get "/:type/:year/:number", MyController, :show

Also Liked

OvermindDL1

OvermindDL1

For note, that generally happens when a call became ambiguous (parameter count changed), in which case following it up with an empty parameter arg fixes it and makes it unambiguous. :slight_smile:

Where Next?

Popular in Questions Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New

Other popular topics Top

JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New

We're in Beta

About us Mission Statement