Frisby Jon
2007-Mar-22 01:59 UTC
[Masterview-users] Found a bug in gen_replace, and have a couple how-to questions...
First, the bug. In parser.rb, this: def generate_replace(value) @renderer.append_raw ERB_EVAL_START+value+ERB_EVAL_END end Should be: def generate_replace(value) @renderer.append_raw ERB_CONTENT_START+value+ERB_EVAL_END end In order to behave as documented at: http://masterview.org/directives.html#mv_gen_replace Second, a how-to question. If I have in-line CSS, like so: <style type="text/css"> #navigation a.home { background:url(/images/arrow.gif); background-position:bottom center; background-repeat:no-repeat; color:#5CC9FF; } </style> How do I abstract out the URL in there so that it works for both the designer and when used through Rails? Third, another how-to question. How do I make something like this work: <a href="index.html" mv:link_to=":action => ''index''"><img src="../../../public/images/home.gif" mv:image_tag="home.gif" width="21" height="21" id="home" alt="go to home page" /></a> Right now, it''s choking out pretty hard by generating code like so: <%= link_to( { ''<%= image_tag( ''home.gif'', :alt => "go to home page", :height => 21, :id => "home", :width => 21 ) %>'' }, :action => ''index'' ) %> -JF
Jeff Barczewski
2007-Mar-22 15:29 UTC
[Masterview-users] Found a bug in gen_replace, and have a couple how-to questions...
On 3/21/07, Frisby Jon <jfrisby at mrjoy.com> wrote:> > First, the bug. In parser.rb, this: > def generate_replace(value) > @renderer.append_raw ERB_EVAL_START+value+ERB_EVAL_END > end > > Should be: > def generate_replace(value) > @renderer.append_raw ERB_CONTENT_START+value+ERB_EVAL_END > end > > In order to behave as documented at: > http://masterview.org/directives.html#mv_gen_replaceThanks Jon. I will add some tests around this and make the fix. Second, a how-to question. If I have in-line CSS, like so:> <style type="text/css"> > #navigation a.home { > background:url(/images/arrow.gif); > background-position:bottom center; > background-repeat:no-repeat; > color:#5CC9FF; > } > </style> > > How do I abstract out the URL in there so that it works for both the > designer and when used through Rails?Well we currently have this type of functionality for external css, but sounds like we do need to consider additional options for both internal styles and styles with images. Let me think about it and see what I can come up with. Third, another how-to question. How do I make something like this work:> > <a href="index.html" mv:link_to=":action => ''index''"><img > src="../../../public/images/home.gif" mv:image_tag="home.gif" > width="21" height="21" id="home" alt="go to home page" /></a> > > Right now, it''s choking out pretty hard by generating code like so: > > <%= link_to( { ''<%= image_tag( ''home.gif'', :alt => "go to home > page", :height => 21, :id => "home", :width => 21 ) %>'' }, :action => > ''index'' ) %> > >I see what you mean. We need a way to accomodate things besides just text since images are a common thing used for links too. I''ll take a look at this too. Thanks for the bug fix and feedback. I''ll see what I can do. Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070322/da6043b4/attachment-0001.html