Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 18 2020 19:48
    PatrickSachs commented #100
  • Nov 18 2020 19:48
    PatrickSachs commented #100
  • Nov 18 2020 19:48
    PatrickSachs commented #100
  • Nov 18 2020 00:18
    YellowApple commented #100
  • Nov 17 2020 20:58
    PatrickSachs closed #100
  • Nov 17 2020 20:58
    PatrickSachs commented #100
  • Nov 13 2020 06:15
    YellowApple commented #100
  • Jul 18 2020 17:21
    PatrickSachs opened #100
  • Mar 11 2020 08:32
    heinrich-fresh edited #99
  • Mar 11 2020 08:31
    heinrich-fresh edited #99
  • Mar 11 2020 08:30
    heinrich-fresh closed #99
  • Mar 11 2020 08:30
    heinrich-fresh opened #99
  • May 31 2019 19:29
    decasm closed #7
  • May 31 2019 17:51
    decasm closed #98
  • May 31 2019 17:51
    decasm closed #8
  • May 31 2019 17:42
  • May 31 2019 17:39
  • May 31 2019 17:37
    decasm opened #98
  • May 31 2019 17:37
    decasm opened #7
  • May 31 2019 17:37
    decasm opened #8
Anne-Gwenn Kettunen
@Annwenn
_>
Ryan S. Northrup (RyNo)
@YellowApple
But aren't being pulled into args, contrary to what @slogsdon just suggested :)
Shane Logsdon
@slogsdon
it's been a while. it's a definite possibility that i could be wrong
it does use Plug parsers after all
Ryan S. Northrup (RyNo)
@YellowApple
Well at least we know that they're being separated out in the Plug.Conn.
Do we want to go ahead and see if they can be spliced in whenever the path-related args are?
YellowApple @YellowApple is spelunking through the relevant code right now
Shane Logsdon
@slogsdon
yeah, that makes more sense now that i think of it more. the args parameter to a controller action is the result of bindings/0, which pulls out all variables coming about from pattern matching in the path
so if there was /my/:cool/:path
that gets parsed to ["my", cool, path]
so bindings/0 would result in [cool: "value1", path: "value2"] when hitting /my/value1/value2
Anne-Gwenn Kettunen
@Annwenn
@slogsdon but it's not a desperate situation, right? :)
Ryan S. Northrup (RyNo)
@YellowApple
For now, it looks like it they should be accessible as a Map in conn.params, so I'll update the docs accordingly.
Anne-Gwenn Kettunen
@Annwenn
oki doki :)
(god I hate those smileys.)
Ryan S. Northrup (RyNo)
@YellowApple
I know, right?
Anne-Gwenn Kettunen
@Annwenn
ffs…
:(
Shane Logsdon
@slogsdon
%{"url" => url} = conn[:params] should be %{"url" => url} = conn.params
and we can always merge the keyword list of path params into the conn.params map
Anne-Gwenn Kettunen
@Annwenn
facepalm
I didn't the difference until now
*didn't see
Shane Logsdon
@slogsdon
i've done the same thing at times
just the other week i was trying to fix an issue in some javascript. it took me about 3-4 days to realize that the "alleged cause" of it wasn't even the problem. it was just a simple data serialization error that was getting muted
Anne-Gwenn Kettunen
@Annwenn
:'D
Ryan S. Northrup (RyNo)
@YellowApple
Aight, docs are fixed.
I think.
I'm still waiting for Erlang to compile on this machine, so I don't know for sure. :/
Anne-Gwenn Kettunen
@Annwenn
\o/
Shane Logsdon
@slogsdon
@YellowApple is your machine hot enough to cook an egg yet?
Ryan S. Northrup (RyNo)
@YellowApple
Not yet, but it's making for a nice space heater under my desk :)
Anne-Gwenn Kettunen
@Annwenn
hmmmm
okay now that I have to define a .html.eex file, the errors appears again
deps/templates/lib/sugar/templates/engines/eex.ex:13: warning: variable assigns is unused
** (CompileError) deps/templates/lib/sugar/templates/engines/eex.ex:13: cannot define module :"Elixir.Sugar.Templates.CompiledTemplates.EEx.not_found.html.eex" because it is currently being defined in deps/templates/lib/sugar/templates/engines/eex.ex:13
(templates) lib/sugar/templates/engines/eex.ex:20: Sugar.Templates.Engines.EEx.compile/1
(sugar) lib/mix/tasks/compile/sugar.ex:62: anonymous fn/2 in Mix.Tasks.Compile.Sugar.do_compile/1
(elixir) lib/enum.ex:1043: anonymous fn/3 in Enum.map/2
(elixir) lib/enum.ex:1385: Enum."-reduce/3-lists^foldl/2-0-"/3
which is very weird because I don't have it on my previous project using Sugar…
Annwenn @Annwenn randomly pokes @YellowApple and @slogsdon
Shane Logsdon
@slogsdon
that happens randomly because the templates library was shoddily created
it's supposed to create a new module for each template file, but for some reason, it doesn't quite work, causing the collisions you see
Anne-Gwenn Kettunen
@Annwenn
:s
okay
Shane Logsdon
@slogsdon
sorry i don't have a better answer for you
the only real way to fix the warnings and errors is to rewrite it or to use EEx manually
the latter can be a simple, interim solution for you
Anne-Gwenn Kettunen
@Annwenn
that's alright I can consider using EEx =)
Anne-Gwenn Kettunen
@Annwenn
or even using static/2.
Anne-Gwenn Kettunen
@Annwenn
@slogsdon silly question but still: How do I configure Sugar to listen exclusively on ::1/127.0.0.1 ?
Shane Logsdon
@slogsdon
you'll want to pass the :ip option to Cowboy (https://github.com/elixir-lang/plug/blob/master/lib/plug/adapters/cowboy.ex#L7) via the :http/:https Sugar options
Anne-Gwenn Kettunen
@Annwenn
Thank you (: It could be wise to include it in the default configuration in mix sugar.init (I think)