From: Florian Weber Date: 2004-07-26T02:56:15+09:00 Subject: Re: rubyonrails and cgikit comparison >> totally simple with rails. you can just write a little helper method >> for for links. >> david already did some nice stuff like this to allow for example: >> <%= link_to "some link", :action => "foo", :params => { "var1" => >> "val1", "var2" => "val2"} %> > > But if you need several times the same link in a page, don't you put > all this several times in the template? What if "var2" => "val2" > should be replaced by "var2" => "val3" for each link? Do you edit each > <%= link_to .... %> ? also very simple. just create a little helper method. then you can do <%= product_link({"var2" => "var3"}) %> >> http://localhost/pages/foo?var1=val1&var2=val2 >> for sure you can also pass additional html options to the link_to >> helper method.. >> the thing you described earlier could be easily done with a little >> helper method >> also.. same thing, just less indirection.. >>> >>>> with cgikit for example you must know whats going on below the >>>> template, how >>>> would you know otherwise which properties you can use for the >>>> repetition item, how >>>> its named, etc? >>> >>> >>> I don't understand what you mean here. You don't specify the >>> repetition item in the template, so no need to know it to design the >>> template. You need it of course for the binding. >> well, but you need to know the the properties of the items when you >> wanna >> display them on the page, no? > > When you use a variable you need to know the way to access it too.... > I'm afraid I still don't get your point. its often said that some templating languages which dont use programming languages and have things like tags to define conditions, loops, etc are great because designer/html-people can just use them easily and dont need to know a programming language.. however that totally ignores that those designers/html-people still need to know which variables/properties exists for the item they are working on.. >>>> for simple views something like xml might work okay. but for more >>>> complex stuff >>>> it becomes very tricky, sometimes even impossible. you need >>>> something like >>>> a 'programming language'. >>>> http://www.martinfowler.com/bliki/UseOfXml.html >>> >>> >>> I must admit I haven't build a very complex website with cgikit >>> (yet?), but from my experience in building a bigger site, I didn't >>> see anything blocking in cgikit. To the contrary, I found it very >>> clear and structured. You don't build your website in xml, you have >>> a template that is HTML with tags that are replaced by >>> html. >> to me the cgikit templates look pretty much like (x)html + xml.. > > I thought you were afraid of all side technologies of XML. Of course > if you can't see any xml combined with (x)html, there's no point to > argue..... not sure if i understand what you mean with that? could you explain further, please.. im definally not afraid of xml though. xhtml is great and xml also. just not for everything. especially not for tasks where a programming language would be just so much easier and better.