anthonator / tilt-jbuilder Goto Github PK
View Code? Open in Web Editor NEWSupport for rendering Jbuilder templates in Tilt
License: MIT License
Support for rendering Jbuilder templates in Tilt
License: MIT License
I'm interested in adding support for this feature. Any insight into what it would take to accomplish this would be very helpful. Thanks!
I wanted to let you know that I've deprecated the lazy loading of tilt/jbuilder by default in tilt. See jeremyevans/tilt@98a75d3. To allow for a transition period, the deprecated support will remain until tilt 3 is released (no ETA yet, and unlikely to be this year). I recommend that you adjust your documentation to explain to users that tilt/jbuilder should be required manually before using the tilt integration.
@anthonator Wondering if you would like to pair with me to make the game works with Lotus?
In term of design, Lotus leverages tilt for its templating engine, so it should be very straight-forward to get it hooked I believe.
LoadError: no such file to load -- securerandom
48 require at org/jruby/RubyKernel.java:1027
49 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/activesupport-3.2.12/lib/active_support.rb:24
50 require at org/jruby/RubyKernel.java:1027
51 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/activesupport-3.2.12/lib/active_support/time.rb:1
52 require at org/jruby/RubyKernel.java:1027
53 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/activesupport-3.2.12/lib/active_support/time.rb:1
54 require at org/jruby/RubyKernel.java:1027
55 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/conversions.rb:1
56 require at org/jruby/RubyKernel.java:1027
57 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/activesupport-3.2.12/lib/active_support/core_ext/hash/conversions.rb:2
58 require at org/jruby/RubyKernel.java:1027
59 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/activesupport-3.2.12/lib/active_support/core_ext/hash.rb:1
60 require at org/jruby/RubyKernel.java:1027
61 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/activesupport-3.2.12/lib/active_support/core_ext/hash.rb:1
62 load at org/jruby/RubyKernel.java:1046
63 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/jbuilder-1.0.2/lib/jbuilder.rb:1
64 each at org/jruby/RubyArray.java:1613
65 (root) at /home/travis/.rvm/gems/jruby-1.7.3-d19/gems/jbuilder-1.0.2/lib/jbuilder.rb:4
66 (root) at /home/travis/build/anthonator/tilt-jbuilder/lib/tilt/jbuilder.rb:1
67 (root) at /home/travis/build/anthonator/tilt-jbuilder/lib/tilt/jbuilder.rb:1
68 (root) at /home/travis/build/anthonator/tilt-jbuilder/spec/sinatra_integration_spec.rb:1
I believe this is an issue with JRuby and RubyGems and not tilt-jbuilder but it's making travis puke so I want to document it.
I'm getting the following error while trying to render with jbuilder. Any ideas why?
ArgumentError - wrong number of arguments (0 for 1+):
/Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-jbuilder-0.5.3/lib/tilt/jbuilder.rb:6:in initialize' /Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/jbuilder-2.0.3/lib/jbuilder.rb:53:in
new'
/Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/jbuilder-2.0.3/lib/jbuilder.rb:53:in encode' /Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-jbuilder-0.5.3/lib/tilt/jbuilder.rb:51:in
block in evaluate'
/Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-jbuilder-0.5.3/lib/tilt/jbuilder.rb:51:in eval' /Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-jbuilder-0.5.3/lib/tilt/jbuilder.rb:51:in
block in evaluate'
/Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-jbuilder-0.5.3/lib/tilt/jbuilder.rb:49:in eval' /Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-jbuilder-0.5.3/lib/tilt/jbuilder.rb:49:in
evaluate'
/Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-1.4.1/lib/tilt/template.rb:103:in render' /Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/sinatra-1.4.4/lib/sinatra/base.rb:805:in
render'
/Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-jbuilder-0.5.3/lib/sinatra/jbuilder.rb:14:in render_with_view_path_support' /Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/sinatra-contrib-1.4.1/lib/sinatra/engine_tracking.rb:91:in
block in render'
/Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/sinatra-contrib-1.4.1/lib/sinatra/engine_tracking.rb:83:in with_engine' /Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/sinatra-contrib-1.4.1/lib/sinatra/engine_tracking.rb:91:in
render'
/Users/Martin/.rvm/gems/ruby-2.0.0-p247@sagittarius/gems/tilt-jbuilder-0.5.3/lib/sinatra/jbuilder.rb:7:in `jbuilder'
Rendering partials like json.partial! 'sizes'
with non existing file fails with ArgumentError - file or block required
.
That's a bit frustrating when there is a typo in a file name, because I definitely pass the file.
Tilt has a special error for this case TypeError, "Can't load the template file. Pass a string with a path ...
I guess this is the expected error in case when file couldn't be found.
When installing this gem alongside the latest Hanami version, after creating a .json.jbuilder
file, this pops up when reloading the browser:
Boot Error
Something went wrong while loading /home/x/hanami/bookshelf/config.ru
NameError: undefined local variable or method `binding' for #<Hanami::View::Rendering::Scope:0x00558771791078>
/home/x/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/hanami-view-0.8.0/lib/hanami/view/rendering/layout_scope.rb:270:in `method_missing'
/home/x/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/hanami-view-0.8.0/lib/hanami/view/rendering/scope.rb:72:in `method_missing'
I'm running into this whenever I call json.partial!
. Sinatra 1.4.5, tilt-1.4.1, til-jbuilder-0.6.1. I can get it to load a template if I do this:
template = Tilt::JbuilderTemplate.new 'index.jbuilder'
But if I try to use the block or call json.partial!
, I get the error in the title. Any help is appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.