From: Bauduin Raphael Date: 2004-07-26T03:16:53+09:00 Subject: Re: rubyonrails and cgikit comparison Florian Weber wrote: > >>> 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.. > Let's take a concrete example. I have developed a CKHTMLTable component, displaying database rows in a table. The designer can work on the template of this component to set it up, although this should mostly mean design a css. When the component is used, there's no need to set it up anymore. Of course, the designer should know this component displays a table, and not a link. But that's the same in Rails if you work with components. But I got your point, and if the programmer doesn't talk with the designer there could be a problem. But that's the downside of using components: the designer has to know what this component is. > >>>>> 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.. Hmm, not sure the english I wrote is correct. I was just meaning that it could come down to you having different preferences than me. > > 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. That's just the point we disagree on. I don't think we should have real programming in the template(like references to variables), some basic logic only. In short, I like the presence of the binding, you don't. That's ok with me ;-) Anyway, thanks for this exchange of opinions. Raph > > > >