Specifying method when using MVC framework as part of a '-define' form causes error
Hey,
Love Artanis. I've been using the MVC framework and it seems pretty neat. When trying to specify the HTTP method for an MVC method however I get an error that I don't seem to be able to resolve:
(index-define contact (method post)
(lambda (rc)
"<h1>This is index#contact</h1><p>Find me in app/views/index/contact.html.tpl</p>"
;; TODO: add controller method `contact'
;; uncomment this line if you want to render view from template
;; (view-render "contact" (the-environment))
))
Results in:
$ art work
Loading conf/artanis.conf...done.
Session with SIMPLE backend init done!
Loading models...
Loading controllers...
Regenerating route cache ...
Backtrace:
10 (apply-smob/1 #<catch-closure e551c0>)
In ice-9/boot-9.scm:
705:2 9 (call-with-prompt _ _ #<procedure default-prompt-handle…>)
In ice-9/eval.scm:
619:8 8 (_ #(#(#<directory (guile-user) ee7140>)))
In /gnu/store/2slcmvlhyr0n5chrr6nyz0df886xb31s-artanis-0.3.1/bin/.art-real:
42:12 7 (_ _ _)
In artanis/commands/work.scm:
135:8 6 (work . _)
In artanis/artanis.scm:
314:2 5 (run #:host _ #:port _ #:debug _ #:use-db? _ #:db-proto …)
In unknown file:
4 (run-hook #<hook 0 1099820 init-work>)
In ice-9/ports.scm:
444:17 3 (call-with-input-file _ _ #:binary _ #:encoding _ # _)
In artanis/commands/work.scm:
88:4 2 (_ #<input: /home/alex/src/komputilo/komputilo.eu/.rout…>)
In ice-9/boot-9.scm:
2330:18 1 (module-ref #<directory (artanis artanis) 11a5460> (post))
In unknown file:
0 (module-variable #<directory (artanis artanis) 11a5460> #)
ERROR: In procedure module-variable:
In procedure module-variable: Wrong type argument in position 2 (expecting symbol): (post)
I think the issue is caused by:
Artanis/utils.scm::908, which uses assq-ref — but cache-this-route!
writes meta entries as a list of lists, not as an alist.
This is because of the way that draw-expander
parses the keywords passed to it.
Does this make sense?
Cheers,
Alex