Difference between goweb's rest interface and RoR's

31 views
Skip to first unread message

Luke Liu

unread,
Jul 27, 2012, 3:13:14 AM7/27/12
to golang...@googlegroups.com
Hi

I have used Goweb for some projects, thank you for your works.

And I notice that the goweb's rest interface miss binding for RoR's 'new' and 'edit' which show a page to create and update an ojbect.

I think it is essitetial for html format and I suggest to include them.

How do you think? and How do you solve this problem?

Christopher Hobbs

unread,
Jul 28, 2012, 9:13:51 AM7/28/12
to golang...@googlegroups.com
I'm relatively new to Go, so my response may be an ignorant one. I'm using goweb on a project and I think I would compare it to Sinatra rather than Rails. It provides a few useful REST shortcuts and then gets out of your way.

To answer the rest of the question, if you want a 'new' route, use the Create function and then use MapFunc to map it accordingly. Put your raw SQL into the Create block or use an orm like beedb to make database interaction a little easier.

I hope I didn't muddy the waters. I'm sure someone else can answer this better than I can.

刘铭

unread,
Aug 1, 2012, 10:04:32 PM8/1/12
to golang...@googlegroups.com
I am trying to add New and Edit function to RestReader, it is a dummy solution, just for quickly fix.

Maybe we can add RestNewer and RestEditor in rest_controller.go?


-- 
刘铭
已使用 Sparrow

matryer

unread,
Aug 2, 2012, 5:34:05 PM8/2/12
to golang...@googlegroups.com
You can always Map your own functions for these using context.MapFunc and leave the MapRest to look after solely RESTful concerns.

If this is a popular request, then maybe we can consider adding New and Edit (what about ConfirmDelete too?)

Mat

刘铭

unread,
Aug 2, 2012, 9:16:36 PM8/2/12
to golang...@googlegroups.com
I think New and Edit are important, if somebody want to build a html-major service.

ConfirmDelete can be done in Javascript side. so I think it is not so essential.

And another important thing:

Htmlformator for rest. it will call the template according the rest action. like read many.html.tmpl, create.html.tmpl…



-- 
刘铭
已使用 Sparrow

Reply all
Reply to author
Forward
0 new messages