Hello I was searching inline templates on camping and found this old
topic on the mailing list with the example from Magnus. I think it
looks great and could be useful but I assume this was not implemented.
Any plan to add this ? :-)
Best Regards
David
Another feature! Inline templates:
  module App::Controllers
    get ''/'' do
      @title = "My Perfect App"
      render :index
    end
  end
  __*END*__
  @@ index.erb
  Welcome to <%= @title %>
What''d you think? Keep or throw away? It costs us 184 bytes at the
moment.
// Magnus Holm
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/camping-list/attachments/20120812/d5928388/attachment.html>
It's been implemented here: https://github.com/camping/camping/commit/407e2ddd441f438722828dc77d9094e0dea66143, but I don't think the current released version of Camping has it. Try `gem install camping --source gems.judofyr.net` for a newer (pre-release) version. -----Original Message----- Re: Feature: Inline templates? From: gurugeek <gurugeekphp at gmail.com> To: camping-list at rubyforge.org Sunday, August 12, 2012 at 5:15PM   Hello I was searching inline templates on camping and found this old topic on the mailing list with the example from Magnus. I think it looks great and could be useful but I assume this was not implemented. Any plan to add this ? :-) Best Regards David Another feature! Inline templates: module App::Controllers get '/' do @title = "My Perfect App" render :index end end __END__ @@ index.erb Welcome to <%= @title %> What'd you think? Keep or throw away? It costs us 184 bytes at the moment. // Magnus Holm   -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20120815/b2de7a64/attachment.html>
What makes this better than a here doc? ? Jenna On Wednesday, 15 August 2012 at 6:18 PM, judofyr at gmail.com wrote:> It''s been implemented here: https://github.com/camping/camping/commit/407e2ddd441f438722828dc77d9094e0dea66143, but I don''t think the current released version of Camping has it. Try `gem install camping --source gems.judofyr.net (http://gems.judofyr.net)` for a newer (pre-release) version. > -----Original Message----- > Re: Feature: Inline templates? From: gurugeek <gurugeekphp at gmail.com (mailto:gurugeekphp at gmail.com)> > To: camping-list at rubyforge.org (mailto:camping-list at rubyforge.org) > Sunday, August 12, 2012 at 5:15PM > > Hello I was searching inline templates on camping and found this old topic on the mailing list with the example from Magnus. I think it looks great and could be useful but I assume this was not implemented. Any plan to add this ? :-) > Best Regards > David > > Another feature! Inline templates: module App::Controllers get ''/'' do @title = "My Perfect App" render :index end end __END__ @@ index.erb Welcome to <%= @title %> What''d you think? Keep or throw away? It costs us 184 bytes at the moment. // Magnus Holm > > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > http://rubyforge.org/mailman/listinfo/camping-list > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20120816/cb0c88ea/attachment-0001.html>
It''s simpler. The alternative would be something like:
module App::Views
  Index = Tilt[''slim''].new { <<-EOF }
html
  head
  body== yield
EOF
end
module App::Controllers
  def index
    Views::Index.render(self)
  end
end
This can also serve static files with correct MIME-type:
__END__
/style.css
* { margin: 0; padding: 0 }
// Magnus Holm
On Wed, Aug 15, 2012 at 4:44 PM, Jenna Fox <a at creativepony.com>
wrote:> What makes this better than a here doc?
>
> ?
> Jenna
>
> On Wednesday, 15 August 2012 at 6:18 PM, judofyr at gmail.com wrote:
>
> It''s been implemented here:
>
https://github.com/camping/camping/commit/407e2ddd441f438722828dc77d9094e0dea66143,
> but I don''t think the current released version of Camping has it.
Try `gem
> install camping --source gems.judofyr.net` for a newer (pre-release)
> version.
>
> -----Original Message-----
> Re: Feature: Inline templates?
> From: gurugeek <gurugeekphp at gmail.com>
> To: camping-list at rubyforge.org
> Sunday, August 12, 2012 at 5:15PM
>
>
>
>  Hello I was searching inline templates on camping and found this old topic
> on the mailing list with the example from Magnus. I think it looks great
and
> could be useful but I assume this was not implemented. Any plan to add this
> ? :-)
>
> Best Regards
>
> David
>
>  Another feature! Inline templates:    module App::Controllers     get
''/''
> do       @title = "My Perfect App"       render :index     end  
end
> __END__   @@ index.erb   Welcome to <%= @title %>  What''d
you think? Keep or
> throw away? It costs us 184 bytes at the moment.  // Magnus Holm
>
>
>
> _______________________________________________
> Camping-list mailing list
> Camping-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
>
>
>
> _______________________________________________
> Camping-list mailing list
> Camping-list at rubyforge.org
> http://rubyforge.org/mailman/listinfo/camping-list
thank you Magnus, great feature ! On Wed, Aug 15, 2012 at 10:18 AM, <judofyr at gmail.com> wrote:> It''s been implemented here: > https://github.com/camping/camping/commit/407e2ddd441f438722828dc77d9094e0dea66143, > but I don''t think the current released version of Camping has it. Try `gem > install camping --source gems.judofyr.net` for a newer (pre-release) > version. > -----Original Message----- > Re: Feature: Inline templates? > From: *gurugeek <gurugeekphp at gmail.com>* > To: camping-list at rubyforge.org > Sunday, August 12, 2012 at 5:15PM > > > Hello I was searching inline templates on camping and found this old topic on the mailing list with the example from Magnus. I think it looks great and could be useful but I assume this was not implemented. Any plan to add this ? :-) > > Best Regards > > David > > Another feature! Inline templates: module App::Controllers get ''/'' do @title = "My Perfect App" render :index end end __*END*__ @@ index.erb Welcome to <%= @title %> What''d you think? Keep or throw away? It costs us 184 bytes at the moment. // Magnus Holm > > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20120815/edac3c4d/attachment.html>
Mmm so it is! Nice! ? Jenna On Thursday, 16 August 2012 at 1:10 AM, Magnus Holm wrote:> It''s simpler. The alternative would be something like: > > module App::Views > Index = Tilt[''slim''].new { <<-EOF } > html > head > body== yield > EOF > end > > module App::Controllers > def index > Views::Index.render(self) > end > end > > This can also serve static files with correct MIME-type: > > __END__ > > /style.css > * { margin: 0; padding: 0 } > > // Magnus Holm > > On Wed, Aug 15, 2012 at 4:44 PM, Jenna Fox <a at creativepony.com (mailto:a at creativepony.com)> wrote: > > What makes this better than a here doc? > > > > ? > > Jenna > > > > On Wednesday, 15 August 2012 at 6:18 PM, judofyr at gmail.com (mailto:judofyr at gmail.com) wrote: > > > > It''s been implemented here: > > https://github.com/camping/camping/commit/407e2ddd441f438722828dc77d9094e0dea66143, > > but I don''t think the current released version of Camping has it. Try `gem > > install camping --source gems.judofyr.net (http://gems.judofyr.net)` for a newer (pre-release) > > version. > > > > -----Original Message----- > > Re: Feature: Inline templates? > > From: gurugeek <gurugeekphp at gmail.com (mailto:gurugeekphp at gmail.com)> > > To: camping-list at rubyforge.org (mailto:camping-list at rubyforge.org) > > Sunday, August 12, 2012 at 5:15PM > > > > > > > > Hello I was searching inline templates on camping and found this old topic > > on the mailing list with the example from Magnus. I think it looks great and > > could be useful but I assume this was not implemented. Any plan to add this > > ? :-) > > > > Best Regards > > > > David > > > > Another feature! Inline templates: module App::Controllers get ''/'' > > do @title = "My Perfect App" render :index end end > > __END__ @@ index.erb Welcome to <%= @title %> What''d you think? Keep or > > throw away? It costs us 184 bytes at the moment. // Magnus Holm > > > > > > > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > > http://rubyforge.org/mailman/listinfo/camping-list > > > > > > > > _______________________________________________ > > Camping-list mailing list > > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > > http://rubyforge.org/mailman/listinfo/camping-list > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org (mailto:Camping-list at rubyforge.org) > http://rubyforge.org/mailman/listinfo/camping-list > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20120816/add26495/attachment.html>