Erlang/OTP Forums

Author Message

<  Erlyweb mailing list  ~  intro tutorial questions

Guest
Posted: Sun Aug 31, 2008 9:44 pm Reply with quote
Guest
Hi, I have 2 questions about the Introduction Tutorial.

I'm using erlyweb 0.7

1) I have problems with forming the href links. From entry_view.et, if
I leave the code as it is,
I get links like:
http://localhost:8000/entry/detail/1
instead of:
http://localhost:8000/blog/entry/detail/1

I fixed this by doing dropping the first '/' from the href link.
Unfortunately the detail pages now have really messed up links like:
http://localhost:8000/blog/category/detail/entry/detail/2

Am I doing something wrong here?

2) This is a conceptual question - could someone please explain to me
the meaning behind:

<% Entry %> (from entry_view.et)
and
<% Entries %> (from category_view.et)
and
<% Data %> (from html_container_view.et)

I don't understand what these are bound to and why. My assumption for
the 1st two is that erlyweb is doing something with the 1:many and the
many:1 relations to generate these. The plural is throwing me - does
erlyweb do pluralization expansions like rails?

--~--~---------~--~----~------------~-------~--~----~
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
jeffm
Posted: Mon Sep 01, 2008 12:11 am Reply with quote
User Joined: 29 Sep 2008 Posts: 43
I don't have the tutorials in front of me at the moment (just warning
you in case I get this a little wrong). With the .et files you'll see a
line of the form:

<%@ detail(Entry) %>

this defines the function detail and binds Entry to the first and only
parameter passed in. Other functions can be defined in this manner.

Jeff.

5hundy wrote:
> Hi, I have 2 questions about the Introduction Tutorial.
>
> I'm using erlyweb 0.7
>
> 1) I have problems with forming the href links. From entry_view.et, if
> I leave the code as it is,
> I get links like:
> http://localhost:8000/entry/detail/1
> instead of:
> http://localhost:8000/blog/entry/detail/1
>
> I fixed this by doing dropping the first '/' from the href link.
> Unfortunately the detail pages now have really messed up links like:
> http://localhost:8000/blog/category/detail/entry/detail/2
>
> Am I doing something wrong here?
>
> 2) This is a conceptual question - could someone please explain to me
> the meaning behind:
>
> <% Entry %> (from entry_view.et)
> and
> <% Entries %> (from category_view.et)
> and
> <% Data %> (from html_container_view.et)
>
> I don't understand what these are bound to and why. My assumption for
> the 1st two is that erlyweb is doing something with the 1:many and the
> many:1 relations to generate these. The plural is throwing me - does
> erlyweb do pluralization expansions like rails?
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
View user's profile Send private message
Guest
Posted: Mon Sep 01, 2008 1:26 am Reply with quote
Guest
> <%@ detail(Entry) %>
>
> this defines the function detail and binds Entry to the first and only
> parameter passed in. Other functions can be defined in this manner.

Okay, yes at least the first two make sense now. I think I pretty much
understand the tutorial now.

Can anyone help me with the href issue?

Something else I've been wondering - I'm used to pluralizing table
names as the standard in Rails. Based on the tutorials and blog posts,
it seems like singular is the standard. Should I stick to that?
--~--~---------~--~----~------------~-------~--~----~
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
Guest
Posted: Mon Sep 01, 2008 11:05 pm Reply with quote
Guest
Yes, table names are not pluralized in ErlyDB. The only pluralization
that happens is in functions that fetch many records in x-to-many
relations, e.g. if you have 'shelf' and 'book' table and a shelf has
many books the generated functions would look like 'shelf:books()'.

On Sun, Aug 31, 2008 at 6:25 PM, 5hundy <dweldon@gmail.com> wrote:
>
>> <%@ detail(Entry) %>
>>
>> this defines the function detail and binds Entry to the first and only
>> parameter passed in. Other functions can be defined in this manner.
>
> Okay, yes at least the first two make sense now. I think I pretty much
> understand the tutorial now.
>
> Can anyone help me with the href issue?
>
> Something else I've been wondering - I'm used to pluralizing table
> names as the standard in Rails. Based on the tutorials and blog posts,
> it seems like singular is the standard. Should I stick to that?
> >
>

--~--~---------~--~----~------------~-------~--~----~
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