Hello! I just started looking into ruby and rubyonrails ( looks awesome ) - so please forgive me if this is a stupid question... I already tried on the Ruby Forum, but nobody answered. Personally, I just really despise the jsp style templating that rubyonrails seems to use - I won''t go into all the many reasons why, as it''s all been discussed to death before. What I''m wondering is whether rubyonrails could be used with amrita ( http://amrita.sourceforge.jp/index.html ) instead? Is this a no-brainer, or would I have to put some effort into it? Would it be possible/reasonable to request that rails support amrita as an alternative templating engine? Thanks! Beers, Corey -- "America at the moment, with its faith-based currency, faith-based economy and faith-based government, might be a heaven for those who love faith, but it''s a hell for those of us that respect evidence." - anon
On Wednesday 13 October 2004 01:32 am, David Heinemeier Hansson wrote:> > What I''m wondering is whether rubyonrails could be used with amrita > > ( http://amrita.sourceforge.jp/index.html ) instead?<snip>> There are no plans to support Amrita-style templates, but a new > template-style will be introduced in the next version based on Jim > Weirich''s Builder class.<snip> Hey, this is pretty killer! I checked out his blog for more info and was very impressed. I''d be more than satisfied w/ Builder as opposed to erb - so when is this next version of rails gonna be released?> P.S.: If anyone would like to examine what it takes to get Amrita > templates in Rails, by all means do. Personally, I find that model > quite unappealing and the extra indirection certainly does make it > harder to fit into Rails than it was with Builder. But with enough > effort, I am sure it could be done. >As I begin to feel more comfortable using ruby, and rails - I''ll look into this; I think it would be valid alternative, as I have to imagine there are at least a few instances where amrita''s clear separation of logic from presentation would be beneficial. Plus, it would make a complete collection of templating options: erb - inline/embedded ruby builder - purely programmatic amrita - purel x/html templates w/ separate data model Cheers, Corey -- "A man is none the less a slave because he is allowed to choose a new master once in a term of years." - Lysander Spooner, ''No Treason. No. VI, The Constitution of No Authority''
On Wednesday 13 October 2004 10:30 am, Tobias Luetke wrote: <snip>> > I have to imagine there are at least a few instances where amrita''s > > clear separation of logic from presentation would be beneficial.<snip>> > Well well, while i respect your preference for another templating > engine I would like to point out that you are trying to seperate your > view from your application with a straw as datapipe. I''m pretty sure > most web programmers have been in the situation where they > discovered that they separated things so much that it was inconvenient. >Definitely. There certainly are pros and cons with each approach.> Ruby is the best scripting language out there, with erb you can use it > inline in templates. This is equivalent with what the best dedicated > template engine will offer you: total control over your data. >I"m extremely impressed with ruby - I''ve ditched perl, and I''m likely going to decide against python/zope3 since discovering rubyonrails.> I suggest you to give erb a try. If you don''t like the way tags are > opened you can change this to whatever style you see fit. > > I''m programming an e-commerce site in ruby on rails and there isn''t a > single rhtml template file which has a erb statement longer than one line. > Just in case you think that using erb leads to programming in the > templates. >It''s true that with discipline and skill, one can largely avoid making a huge mess out of the templates. Like most things, it often comes down to a simple matter of personal preference or habit - though there are cases in which having a choice is beneficial: depending on the specifics of a project, a particular templating engine can provide a more natural fit. Beers! Corey -- "Government begins by protecting some against others and ends up protecting itself against everyone." - Robert LeFevre
> What I''m wondering is whether rubyonrails could be used with amrita > ( http://amrita.sourceforge.jp/index.html ) instead? Is this a > no-brainer, or > would I have to put some effort into it? Would it be > possible/reasonable > to request that rails support amrita as an alternative templating > engine?There are no plans to support Amrita-style templates, but a new template-style will be introduced in the next version based on Jim Weirich''s Builder class. This will allow you to programatically generate views. Especially useful for RSS, but also useful for regular views in a programmer-driven design. See more on: http://www.codepaste.org/view/paste/263 P.S.: If anyone would like to examine what it takes to get Amrita templates in Rails, by all means do. Personally, I find that model quite unappealing and the extra indirection certainly does make it harder to fit into Rails than it was with Builder. But with enough effort, I am sure it could be done. -- David Heinemeier Hansson, http://www.rubyonrails.org/ -- Web-application framework for Ruby http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby http://macromates.com/ -- TextMate: Code and markup editor for OS X http://www.basecamphq.com/ -- Web-based Project Management http://www.loudthinking.com/ -- Broadcasting Brain http://www.nextangle.com/ -- Development & Consulting Services
> As I begin to feel more comfortable using ruby, and rails - I''ll look into > this; I think it would be valid alternative, as I have to imagine there are > at least a few instances where amrita''s clear separation of logic from > presentation would be beneficial. Plus, it would make a complete > collection of templating options:Well well, while i respect your preference for another templating engine I would like to point out that you are trying to seperate your view from your application with a straw as datapipe. I''m pretty sure most web programmers have been in the situation where they discovered that they separated things so much that it was inconvenient. Ruby is the best scripting language out there, with erb you can use it inline in templates. This is equivalent with what the best dedicated template engine will offer you: total control over your data. I suggest you to give erb a try. If you don''t like the way tags are opened you can change this to whatever style you see fit. I''m programming an e-commerce site in ruby on rails and there isn''t a single rhtml template file which has a erb statement longer than one line. Just in case you think that using erb leads to programming in the templates.
On Tue, Oct 12, 2004 at 11:13:31PM -0700, Corey wrote:> It''s true that with discipline and skill, one can largely avoid making a > huge mess out of the templates. Like most things, it often comes > down to a simple matter of personal preference or habit - though > there are cases in which having a choice is beneficial: depending on > the specifics of a project, a particular templating engine can provide > a more natural fit.Also keep in mind that a lot of the boiler plate logic that you don''t want in the template can be put into helper methods. marcel -- Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org>
> I''d be more than satisfied w/ Builder as opposed to erb - so when is > this > next version of rails gonna be released?A finished version of the Builder integration is already in the CVS for Action Pack. A release date really depends on how many of the issues from the bug tracker I feel that I want to deal with. I''ve been saying something about this week. But I think it might tip into the next. -- David Heinemeier Hansson, http://www.rubyonrails.org/ -- Web-application framework for Ruby http://www.instiki.org/ -- A No-Step-Three Wiki in Ruby http://macromates.com/ -- TextMate: Code and markup editor for OS X http://www.basecamphq.com/ -- Web-based Project Management http://www.loudthinking.com/ -- Broadcasting Brain http://www.nextangle.com/ -- Development & Consulting Services
Corey, Interesting that you should mention Rails & Amrita. I have been thinking of writing a Rails controller for Amrita since there are some nice open source tools for Amrita, e.g. the Web Publisher Eclipse plug-in ( http://webpub.narucy.com/index.en.html). I really like how quickly I can mock up a page using plain old ruby objects with this tool, but unfortunately it does not supply any kind of controller for use with a dynamic web application. Writing an Amrita controller in Rails/ActionPack might be just the thing to help bring these communities together. Rails would benefit from having the rapid prototyping Amrita & this Web Publisher tool could bring it, esp. since most of rapid development bells and whistles of Rails (scaffolding, etc.) requires you to use ActiveRecord--which is not at all useful when your data source is not a database. John-Mason