I''m trying to use mv:import to pull in the layouts/application.rhtml. I have tried putting <div mv:import="layouts/application.rhtml"> <div mv:generate="searcher/new.rhtml"> content for page </div> </div> hoping that Masterview would be able to make sense of that. It was probably a long shot and I got NoMethodError (You have a nil object when you didn''t expect it! The error occurred while evaluating nil.gsub): /opt/local/lib/ruby/gems/1.8/gems/masterview-0.3.2/lib/masterview/core_ext/pathname.rb:8:in `for_path'' /opt/local/lib/ruby/gems/1.8/gems/masterview-0.3.2/lib/masterview/directive_helpers.rb:23:in `render_partial_name_to_file_name'' /opt/local/lib/ruby/gems/1.8/gems/masterview-0.3.2/lib/masterview/analyzer.rb:165:in `start_element'' /opt/local/lib/ruby/gems/1.8/gems/masterview-0.3.2/lib/masterview/analyzer.rb:159:in `each_pair'' /opt/local/lib/ruby/gems/1.8/gems/masterview-0.3.2/lib/masterview/analyzer.rb:159:in `start_element'' /opt/local/lib/ruby/gems/1.8/gems/masterview-0.3.2/lib/rexml/parsers/sax2parser_with_doctype_fix.rb:135:in `parse'' /opt/local/lib/ruby/gems/1.8/gems/masterview-0.3.2/lib/rexml/parsers/sax2parser_with_doctype_fix.rb:134:in `each'' /opt/local/lib/ruby/gems/1.8/gems/masterview-0.3.2/lib/rexml/parsers/sax2parser_with_doctype_fix.rb:134:in `parse'' ... If this is not the proper way to handle design time inclusion of the layout, what would be a solution? David Koontz
On 4/10/07, David Koontz <david at koontzfamily.org> wrote:> I''m trying to use mv:import to pull in the layouts/application.rhtml. I > have tried putting > > <div mv:import="layouts/application.rhtml"> > <div mv:generate="searcher/new.rhtml"> > content for page > </div> > </div>(snip)> If this is not the proper way to handle design time inclusion of the > layout, what would be a solution?inserting a <div mv:replace="@content_for_layout"> element between <div mv:import> and <div mv:generate> should solve the problem. resulting code would be: <div mv:import="layouts/application.rhtml"> <div mv:replace="@content_for_layout"> <div mv:generate="searcher/new.rhtml"> content for page </div> </div> </div> hiro
On 4/10/07, Hiroki Yoshioka <irohiroki at gmail.com> wrote:> > On 4/10/07, David Koontz <david at koontzfamily.org> wrote: > > I''m trying to use mv:import to pull in the layouts/application.rhtml. I > > have tried putting > > > > <div mv:import="layouts/application.rhtml"> > > <div mv:generate="searcher/new.rhtml"> > > content for page > > </div> > > </div> > (snip) > > > If this is not the proper way to handle design time inclusion of the > > layout, what would be a solution? > > inserting a <div mv:replace="@content_for_layout"> element > between <div mv:import> and <div mv:generate> should solve the problem. > resulting code would be: > > <div mv:import="layouts/application.rhtml"> > <div mv:replace="@content_for_layout"> > <div mv:generate="searcher/new.rhtml"> > content for page > </div> > </div> > </div> > > hiro > _______________________________________________ >David, Did Hiro''s suggestion get you past your problem with importing application.rhtml? Regardless I think I am going to look into why your error occurred so it can be handled properly. Blessings, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070417/532ec6f8/attachment.html
Jeff Barczewski wrote:> On 4/10/07, *Hiroki Yoshioka* <irohiroki at gmail.com > <mailto:irohiroki at gmail.com>> wrote: > > On 4/10/07, David Koontz <david at koontzfamily.org > <mailto:david at koontzfamily.org>> wrote: > > I''m trying to use mv:import to pull in the > layouts/application.rhtml. I > > have tried putting > > > > <div mv:import="layouts/application.rhtml"> > > <div mv:generate="searcher/new.rhtml"> > > content for page > > </div> > > </div> > (snip) > > > If this is not the proper way to handle design time inclusion of the > > layout, what would be a solution? > > inserting a <div mv:replace="@content_for_layout"> element > between <div mv:import> and <div mv:generate> should solve the > problem. > resulting code would be: > > <div mv:import="layouts/application.rhtml"> > <div mv:replace="@content_for_layout"> > <div mv:generate="searcher/new.rhtml"> > content for page > </div> > </div> > </div> > > hiro > _______________________________________________ > > > > David, > > Did Hiro''s suggestion get you past your problem with importing > application.rhtml? > > Regardless I think I am going to look into why your error occurred so > it can be handled properly. > > Blessings, > > Jeff > ------------------------------------------------------------------------Jeff, Yeah Hiro''s suggestion did work. Is that the consensus for the "right" way to achieve that goal? Would it make sense to have a variation of import that automatically inserts the <div mv:replace="@content_for_layout">? David Koontz
On 4/19/07, David Koontz <david at koontzfamily.org> wrote:> > Jeff Barczewski wrote: > > On 4/10/07, *Hiroki Yoshioka* <irohiroki at gmail.com > > <mailto:irohiroki at gmail.com>> wrote: > > > > On 4/10/07, David Koontz <david at koontzfamily.org > > <mailto:david at koontzfamily.org>> wrote: > > > I''m trying to use mv:import to pull in the > > layouts/application.rhtml. I > > > have tried putting > > > > > > <div mv:import="layouts/application.rhtml"> > > > <div mv:generate="searcher/new.rhtml"> > > > content for page > > > </div> > > > </div> > > (snip) > > > > > If this is not the proper way to handle design time inclusion of > the > > > layout, what would be a solution? > > > > inserting a <div mv:replace="@content_for_layout"> element > > between <div mv:import> and <div mv:generate> should solve the > > problem. > > resulting code would be: > > > > <div mv:import="layouts/application.rhtml"> > > <div mv:replace="@content_for_layout"> > > <div mv:generate="searcher/new.rhtml"> > > content for page > > </div> > > </div> > > </div> > > > > hiro > > _______________________________________________ > > > > > > > > David, > > > > Did Hiro''s suggestion get you past your problem with importing > > application.rhtml? > > > > Regardless I think I am going to look into why your error occurred so > > it can be handled properly. > > > > Blessings, > > > > Jeff > > ------------------------------------------------------------------------ > Jeff, > > Yeah Hiro''s suggestion did work. Is that the consensus for the "right" > way to achieve that goal? Would it make sense to have a variation of > import that automatically inserts the <div > mv:replace="@content_for_layout">? > > David KoontzI''ll take a closer look at that. We do want it to be as easy as possible to use. Thanks, Jeff -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-users/attachments/20070420/c71e36ad/attachment.html