Erlang Mailing Lists

Author Message

<  Erlyweb mailing list  ~  bug: annoying double slash in function a/? if AppRoot is mis

Guest
Posted: Tue Jul 29, 2008 3:46 pm Reply with quote
Guest
Hi,

I didn't define an AppRoot for my blog application (I'm on 0.7.2) , so
I get a double / -> // for magic components for these statements in
erlyweb_view.et

It concerns these statements (grepped):

erlyweb_view.et:14:<% a([AppRoot, Model, <<"new">>], <<"create new">>)
%><br><br>
erlyweb_view.et:23:<% a([AppRoot, Model, <<"delete">>, Id],
<<"delete">>) %>

My yaws.conf looks like this:

< server localhost >
port = 8000
listen = 127.0.0.1
docroot = /home/luser/projects/blog/www
appmods = <"/", erlyweb> ## !!

<opaque>
appname =
blog
</opaque>
< /server >


I tried hacking the join/1+2 function to not accept an element in the
Args list parameter if a "" =:= [] is present, like this:

%% A helper function
join(Args) ->
join(Args, []).

join([], _) -> [];
join([Last], Acc) ->
lists:reverse([Last | Acc]);
join([First | Rest], Acc) when First =:= [] -> %% !!
join(Rest, Acc);
join([First | Rest], Acc) when First =/= [] -> %% orig.
join(Rest, [[First, $/] | Acc]).

But it's not working as I expect. It should filter out null values.

I think a nice filter for [] =:= "" might work for a/2 in module
erlyweb_html.

What do you guys think? The cost is only O(1) since the double slashed
part of "//component/function/par" makes firefox think the target is
htttp://component/function/par

I haven't tested on other browsers except opera and firefox (covers
all of mozilla methinks). Both fail.

I'll try to fix this using a filter on the a/2 definiton in
erlyweb_html.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "erlyweb" group.
To post to this group, send email to erlyweb@googlegroups.com
To unsubscribe from this group, send email to erlyweb-unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum