Displaying 20 results from an estimated 800 matches similar to: "erubis on rails"
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
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 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
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
2006 Jan 31
3
Lost in routing
I''m trying to create a modules based system where my controllers are
all under modules. So the structure looks something like:
app/
controllers/
message/
news_controller.rb
email_controller.rb
library
books_controller.rb
pictures_controller.rb
home_page_controller.rb
Each of those controller has
2010 Nov 20
0
Enabling preprocessing in Erubis makes views much faster
I wrote a 5 line hack that you can drop into your initializers
directory to enable preprocessing in Erubis. This will run code in <
%=== %> brackets at compile time making views considerably faster for
rails helpers that only need to be evaluated once instead of on each
render (the Erubis docs mention 20-40% speed increase but obviously it
depends on the amount you precompile).
For example:
2007 Aug 21
7
Signin to LinkedIn
Hi,
Does anyone have the formula for getting logged into LinkedIn?
Here''s my current attempt:
require ''rubygems''
require ''mechanize''
agent = WWW::Mechanize.new
home_page = agent.get(''http://www.linkedin.com'')
signin_page = agent.click home_page.links.text(''Sign in'')
puts "\nSIGNIN PAGE"
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
2008 May 23
10
View Specs vs. Stories
Do RSpec stories make view specs redundant? Does anybody spec their
views *and* use stories, and if so how?
Any views (no pun intended) appreciated.
~ Thanks
Mark
--
Posted via http://www.ruby-forum.com/.
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
2006 Oct 31
12
Moving page_cache_directory
Howdy. I''m working on a RoR CMS and need cached pages to all be in
public/cache rather than public [in order to set svn:ignore on all the files
properly]. I can get page_cache_directory set correctly and the pages are
cached in the right place but Mongrel isn''t serving them because it''s only
looking for them in public. During development I know I can set -r
public/cache
2008 May 26
7
Mocking Models in Controller Specs...
I find myself doing this kind of thing a lot in Controller Specs:
@vacancy = mock_model(Vacancy)
@vacancy.stub!(:reference)
@vacancy.stub!(:title)
@vacancy.stub!(:created_at)
@vacancy.stub!(:updated_at)
@vacancy.stub!(:body)
@vacancy.stub!(:contract)
@vacancy.stub!(:location)
@vacancy.stub!(:salary)
@vacancy.stub!(:benefits)
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
2007 Feb 13
4
PDF Thumbnail - RMagick
Hi,
I need to create a preview of a PDF upload to a CMS I''m building. Does
anyone know how to create a thumbnail of the first page of a PDF using
RMagick?
Any ideas welcome,
~ Mark
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
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 Jul 10
7
How to obscure/encrypt password parameter?
Hi all-
I am building an application that includes a login screen. During
development I found that user passwords are logged by Rails in plain
text -- this will not be acceptable to my users. Is there a way to
obscure/encrypt incoming password parameters or not write them to the
log files at all? One thought was to use Javascript, but I was not sure
how secure that would be.
Thanks,
Josh
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 Dec 19
7
Improve the rendering speed of rhtml
I found through the log file that the render of the rhtml template would
take too much time if there exists ruby code in the rhtml files.In many
cases,these ruby code are tied with these rhtml files closely and can
not be decoupled from that,therefore,i have a question that,is there
exist some way to improve the rendering speed of rhtml when some ruby
codes are included?
--
Posted via
2007 Aug 13
1
SqueezeBox, a new Mongrel handler
SqueezeBox is a simple file system based routing framework for erubis
templates.
It aims for a couple of niceties as well:
Instead of putting your logic inside your template, like you would
with PHP, SqueezeBox recognizes a separate logic file to be called
before it loads the template. This allows you room to load
ActiveRecord models or do calculations. These logic files return to
the webserver
2012 Jul 31
1
puppet doc questions
Does puppet doc require a specific version of any gems (such as rdoc or
rake) to operate?
I''m getting some errors when I try to generate my rdoc now.
# puppet doc --output /var/www/test --modulepath
/etc/puppet/environments/test/modules -m rdoc
RDoc::RDocError is deprecated and will be removed in RDoc 4
Could not generate documentation: uninitialized constant
RDoc::RDoc::Generator