For some reason, br is defined in Rapid rather than as a static tag. You have several options.
1) include rapid from your dryml 2) add <def tag="empty-tag" attrs="tag-name"><%= element(tag_name, attributes, nil, true, true) %></def> <def tag="br"><empty-tag tag-name="br" merge/></def> to your DRYML. (or a simplified version of this) 3) add br to dryml/lib/dryml/static_tags cheers, Bryan On Thu, Sep 13, 2012 at 11:12 AM, Yannick Chevalier <[email protected]> wrote: > Hi all, > > first, thanks to Bryan Larsen for pointing me here. My original question > was: > > For some reasons I have to call directly Dryml.render. > However it breaks on the <br> tag, e.g. (in any rails console): > 1.9.3p194 :008 > str="<p>a paragraph</p>".html_safe > => "<p>a paragraph</p>" > 1.9.3p194 :009 > Dryml.render str, :this => nil > => "<p>a paragraph</p>" > 1.9.3p194 :010 > str="<br /><p>a paragraph</p>".html_safe > => "<br /><p>a paragraph</p>" > 1.9.3p194 :011 > Dryml.render str, :this => nil > NoMethodError: undefined method `br' for > #<ActionView::Base:0x00000002db5220> > from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/dryml-1.4.0.pre6/lib/dryml/template_environment.rb:635:in > `method_missing' > from <br /><p>a paragraph</p>:1:in `block in render_page' > from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/dryml-1.4.0.pre6/lib/dryml/template_environment.rb:318:in > `block in new_object_context' > from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/dryml-1.4.0.pre6/lib/dryml/template_environment.rb:281:in > `block in new_context' > from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/actionpack-3.1.6/lib/action_view/helpers/capture_helper.rb:187:in > `with_output_buffer' > from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/dryml-1.4.0.pre6/lib/dryml/template_environment.rb:281:in > `new_context' > from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/dryml-1.4.0.pre6/lib/dryml/template_environment.rb:295:in > `new_object_context' > from <br /><p>a paragraph</p>:1:in `render_page' from > /home/ychevali/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/dryml-1.4.0.pre6/lib/dryml.rb:189:in > `render' > from (irb):11 from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/railties-3.1.6/lib/rails/commands/console.rb:45:in > `start' > from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/railties-3.1.6/lib/rails/commands/console.rb:8:in > `start' > from > ~/.rvm/gems/ruby-1.9.3-p194@hobo2/gems/railties-3.1.6/lib/rails/commands.rb:40:in > `<top (required)>' > from script/rails:6:in `require' from script/rails:6:in `<main>' > I have just downloaded the latest hobo and dryml gems, and would like to > know whether > this is a bug or a miscomprehension before delving into the code > Thanks in advance > --- > In his reply Bryan mentioned that the did not see a reason for calling > directly Dryml.render > (and gave some hints on how to solve the problem, though I haven't tried > them yet, I was > working on non-hobo stuff). Let's try to explain: > I want to put my courses (in LaTeX) in a hobo-constructed website. I have > already translated > the latex sources to html, split the course in different files according to > sections, and > associated a model to each chunck. > Now in LaTex one can write references to other sections, and I would like to > keep these > in the website. Thus, I tried a bit of "sed" to replace references to > sections by references > to the objects that model the section (an object that contains the name of a > file, plus > other non-relevant attributes). However, this means that the content of the > files is no longer > static, as the "link to object" part is written in Dryml. Hence my call > Dryml.render > to update the links when the file is loaded. > I put quite a bit of effort in this (given that I am not a real hobo/rails > programmer), but > I am also open if there exists more simple ways of doing this > > bests, > Yannick > ps: thanks to Bryan Larsen for his reply ! I almost forgot ! > > > -- > You received this message because you are subscribed to the Google Groups > "Hobo Users" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/hobousers/-/-HbT4niUByUJ. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/hobousers?hl=en. -- You received this message because you are subscribed to the Google Groups "Hobo Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/hobousers?hl=en.
