Displaying 20 results from an estimated 500 matches similar to: "Enabling preprocessing in Erubis makes views much faster"
2010 Apr 06
3
(Rails3-master) erubis: how to use things like preprocessing?
(Rails3 latest git master)
Subject says it. I''m trying to figure out how to use erubis features
described here: http://www.kuwata-lab.com/erubis/users-guide.05.html#rails,
especially preprocessing. My question is, where do I place the
Erubis::Helpers::RailsHelper.preprocessing=true
Not in application.rb, at that point the object does not exist yet it
seems. I wonder why I
2006 Dec 20
0
Erubis / Rails Question
I''m trying to figure out whether the fix for an error I get when using
Erubis belongs to Erubis or Rails so I can submit a bug/patch/whatever. When
you use form_for in an Erubis template the instance_eval uses _erbout
instead of _buf. I found the solution [adding
ActionView::Base.erb_variable= "_buf" to the setup in
app/controllers/application.rb] but in searching
out
2006 Dec 22
2
erubis on rails
Hey,
Just thought I''d see how easy it was to use erubis rather than erb in
rails, and so far all seems to be pretty easy. Just added a few lines in
environment.rb and everything works as before.
However, one page is causing a problem. It is a partial that is being
passed a local variable. erubis doesn''t seem to see the local, and gives
the following error?
undefined local
2007 Apr 03
4
Replacing ERB with Erubis
Hey guys,
I''ve been hearing a lot about erubis: http://www.kuwata-lab.com/erubis/
Especially about how much faster it is than straight ERB.
In their Ruby on Rails support docs: http://www.kuwata-lab.com/erubis/users-guide.05.html#topics-rails
They state that with a few added lines to your environment.rb it will
replace ERB completely.
I''m wondering if anyone has done this in
2006 Apr 03
0
documentation question (ri and binding vs. get_binding vd getBinding)
I was reading up on ERB documentation and a snippet on rhtml
requiring the use of Object.get_binding caught my attention:
...
rhtml = ERB.new("someTemplate")
rhtml.run(someObject.get_binding)
...
Curious about tools I have at my disposal to learn more about things
I don''t know about Ruby, i typed the following into my DOS console:
ri get_binding
and got the following
2007 Aug 29
11
Non-Erubis Templates
Trunk Issue: Because of the use of ''autoload'', template handlers other
than Erubis are not loaded automatically (Haml, XMLBuilder). Either
this should be fixed, or the documentation should be updated to
instruct people how to use non-Erb template engines.
Apparently the solution is to do something like this in merb_init.rb:
::Merb::AbstractController.register_engine
2010 Nov 05
9
[patch] Let's use <%== %> instead of <%= raw() %>
I''ve submitted a small patch to make Rails behave properly with the
Erubis <%== %> construct. For some reason the current behaviour of
that tag in Rails 3 is to escape the contents _twice_ which is
probably a bug.
I offer three suggestions why this is a good idea:
- The syntax is cleaner. It can avoid a lot of .html_safe and raw in
your views. I especially like the conciseness of
2011 Oct 30
2
Could not find rails (>= 0) amongst [bundler-1.0.21]
Hello, I''m new to Ruby and unix/linux development (although been
building .net apps for years).
I''ve almost completed my trek to install Rails ... looks like I have one
final hurdle. After installing rails I try the ''rails -v'' command and
it fails. Any help here would be deeply appreciated.
Here''s the output from my bash session:
bash-3.2$ ruby
2007 Sep 04
11
returning(...) ?
The following construct is an ActiveSupport-ism:
returning(Foo.new) do |foo|
...
end
I don''t especially like it, since it''s both more verbose and less efficient
than the direct alternative:
foo = Foo.new
...
foo
It doesn''t occur many times in Merb, so does anyone agree with me that it
should be removed?
I tried doing this (patch attached) and I find
2011 Sep 13
3
Accessing Rails helper method with_output_buffer
Hi all,
I cannot figure out how to correctly use the with_output_buffer helper
method (located in ActionView::Helpers::CaptureHelper) inside a custom
FormBuilder.
Below follows a simplified example.
I''m trying to achieve the following behavior in an ERB as suggested in
the form_for helper docs in the Rails source:
==========
<%= form_for @object, :builder => MyFormBuilder do
2011 Jun 26
1
ActionView::Template::Error (Cannot modify SafeBuffer in place):
Hello,
Trying to upgrade an app that was running fine in 3.0.3 to 3.0.9 and
while everything works well, I get this error:
ActionView::Template::Error (Cannot modify SafeBuffer in place):
When passing a string to this function (in application_helper.rb)
through a simple: <%= format_me(article[shortdesc])%>
def format_me(text, html_options={}, options={})
text =
2006 Jun 30
2
Eruby.import -> "uninitialized constant" error
I''m working on porting a dynamic website done in PHP over to mod_ruby. I
have everything set up and working nicely (I can make a .rhtml page, put
ruby code between <% %> and it works etc), but when I try to use
"Eruby.import" as a sort of analog to PHP''s "require_once()", I run into
trouble.
1) eruby is in my cgi-bin
2) here''s a sample of
2012 Aug 19
0
Unsuccessful with using mongodb with rails
I have had a frustrating time trying to get mongodb to work with Rails (works just fine with a plain Ruby app).
cannot load such file -- mongo
The error is traced to the code line <requires ''Mongo''>.
bundle initialize shows I have it all. Any ideas?
Thanks,
Shiv
$ bundle install
Using rake (9.2.2)
2012 Nov 16
0
With streaming on, closed client connections cause Fatal Broken Pipe errors
Once we turned streaming on on www.songkick.com, we started getting these
errors on production quite a bit. (See below)
It appears that if the client closes the connection during the rendering of
the template, the next attempt to write a portion of the page to the
connection will fail with a Broken Pipe error, understandably. Rails
catches this and turns it into a ActionView::Template::Error.
2005 Apr 08
0
switch mod_ruby to fastcgi but still use eruby?
Hello there list-
I have a question I hope someone can answer. I have a Debian server
that currently has mod_ruby and eruby installed and working great for
the last year or so. I also have one rails app working great on this
box. My question is this: I want to switch to fastcgi so i can have
more than one rails app, but there are already many scripts using eruby
with no framework at all just
2007 Sep 28
2
RoR uses something rather than erb or eRuby?
it seems that RoR doesn''t use erb or eRuby to generate its output for
rhtml?
the program erb and the description of eRuby at
http://www.eruby.info
both said that
<% print "foo bar" %> or <% puts "hello" %>
will be placed into the output...
but currently for RoR, it won''t...
only <%= expr %> is doing it and it cannot be print or
2006 Jun 04
4
eRuby & Rails: Not Compatible
I''m new to Ruby, Rails, and this list. I''ve tried searching for an
answer but it all seems to be over my head. I have all the books but
again they seem to leave me on my own to figure out the stuff that
really matters. Where is the best place to find out the details?
Exactly what are these much celebrated "naming conventions"; i.e. where
do I find an exhaustive
2008 Jan 03
3
Whats the merb equivilant of this?
Hey All
Quick question, what''s the merb equivalent of this:
ActionView::Base.new([template_root], assigns, self)
in merb? Ive found
Merb::Template::Erubis.transform(:file => ''/path/to/file'')
But I''ve no idea if thats the correct thing to be calling? It doesn''t
''feel'' right, so im not sure it is?
Thanks
Tim
2011 Apr 30
1
Could not autoload inventory_active_record: uninitialized constant ActiveRecord
Trying to set up the inventory service on puppet 2.6.8, pretty sure
I''ve met all the dependencies but puppetmaster logs
Could not autoload inventory_active_record: uninitialized constant
ActiveRecord
When clients attempt to connect.
local gems:
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.7, 2.2.3)
actionpack (3.0.7, 2.2.3)
activemodel (3.0.7)
activerecord (3.0.7)
2006 Jun 22
2
eRuby/erb
Hello. Prospective Mongrel user here.
Can Mongrel act as a server for eruby or erb files?
Example:
<html>
<body>
<p>The time is <%= Time.now %></p>
</body>
</html>
Pistos