similar to: ERB help. not seeing variables?

Displaying 20 results from an estimated 60000 matches similar to: "ERB help. not seeing variables?"

2007 Aug 11
0
nested layouts
hi, I''m using a helper like in nested-layouts plugin as follows def inside_layout(layout, &block) layout = layout.include?(''/'') ? layout : "layouts/#{layout}" @template.instance_variable_set(''@content_for_layout'', capture (&block)) concat( @template.render( :file => layout, :user_full_path => true ),
2006 Sep 20
0
boy, that mongrel_upload_progress handler sucks!
I started actually using the upload progress handler, and noticed it was leaking memory over time. Looking at the code, I noticed that cancelled uploads weren''t being cleaned up. I bugged Zed about adding a request_abort callback to handlers, but I found a simple way to monkey patch that in: # config/mongrel_upload_progress.conf # yes, this file is being used with -S meaning
2012 Apr 24
3
How to increment variable in erb template ?
Hi'', I''m looking for a way to increment variable in template (erb file). I tried this, but it didn''t work Compteur <%= compteur %> > <% compteur = compteur + 1 %> > Compteur <%= compteur %> > I''ve got this error : > Error 400 on SERVER: Failed to parse template test/test.erb: undefined > method `+'' for
2006 Mar 12
0
ERB and Builder template engines shouldn''t be so heavily wired in ActionView::Base
Problem: 1. ERB and Builder template engines are heavily wired in ActionView::Base 2. Should be optional. If we use different engine - why load all their stuff if not needed? 3. There are template engines which expect files in their own locations and cache them in their own way. For instance a template engine may store templates in a database. These engines don''t need any central source
2006 Sep 26
1
erb problems
Hi List, I just read this mail on the rails mailing list, that might be of interest for ferret. I don''t even know if it is true, that ferret is causing the erb problems. If it is, then the fix of rmagick might be applicable to ferret too... Cheers, Jan Caleb wrote: > Sure enough, I did a search and replace for tabs and replaced them with > spaces. Is this a difference in the way
2010 Aug 06
0
adding options to erb scaffold generator to include or skip custom views / templates
created a small patch.. looking for feedback / etc.. https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/5319-adding-options-to-erb-scaffold-generator-to-include-or-skip-custom-views-templates#ticket-5319-2 When I was working on customizing the erb scaffold generator to match the style and design I wanted to use by creating custom templates in / lib/templates/erb/scaffold I found
2012 Aug 13
2
Variables and scope with inherits
I want to have a parametrized class with lookup from params.pp but I keep getting into problems. init.pp: class foo ( $bar = $foo::params::bar, $foofoo = $foo::params::foofoo ) inherits foo::params { file {''/tmp/foobar'': content => template("foo/foobar.erb"), } } params: class foo::params { $bar = true if $foo::bar { $foobar =
2011 Oct 12
4
How to access controller's instance variable in a js.erb loaded by javascript_include_tag?
Hello! In rails 3.1 app I have a controller UsersController with ''show'' action. show.html.erb contains: <% content_for(:head) do %> <%= javascript_include_tag ''myscript'' %> <% end %> <p>Hello @user.name</p> And I have this in myscript.js.erb $jQuery(document).ready(function() { alert(<%= @user.name %>); }); @user is being
2010 Aug 19
0
Camping 2.1 - ERB, Haml, 1.9, bug fixes, new website!
{} || || ~~~~~~~~~~~~~~~ <= _whycake ~ Camping 2.1 ~ ~~~~~~~~~~~~~~~ I''m pleased to announce another release of Camping, the microframework. This time we''ve focused on improving the 1.9 support, adding (builtin) support for more template engines, refreshing the homepage and just general bug fixes. gem install camping Home:
2006 Jul 25
3
about ERB sample
Hi list: I run the ri''s ERB doc 1st sample 1. require ''erb'' 2. x = 42 3. template = ERB.new <<-EOF 4. The value of x is: 5. EOF 6. puts template.result(binding) the doc say it will print "The value of x is: 42" but my irb print "nil" and there is a "=> #<ERB:0x2970b24
2008 Nov 18
1
Missing js.erb template
Dear all I am new to web development, and I am working on some simple ajax function and got the following error that may need your expert opinions. Missing template ecpath_app_version/__version_list.js.erb in view path D:/Ruby/test/ssc_1/app/views I know there is no js.erb file in app/view/<controller> folder, and I don''t know what content should be in the js.erb. Are there any
2010 Jun 24
0
Rails3: render_to_string of a .html.erb when request is a json request raises MissingTemplate error
I''ve the following situation (which actually works in Rails 2.3.8 and this is a result of the migration of our app to rails3): I have a partial which is rendered a few times (imagine tr''s in a table). On the clientside there''s a script that does a json request for a specific row (jQuery + ajax dataType: ''json'' and type: ''POST'') In
2012 Nov 27
1
controller not rendering existing js.erb file
In my PlaceController, I have a search method, called remotely from a form the method is executed, but rendering is not executed as the template is stated as missing .. but it''s there ... post :search, :locale => I18n.locale, :format => :js, :country => "United" Error: test_should_search_places(Backoffice::PlacesControllerTest) ActionView::MissingTemplate:
2012 Nov 01
0
Lookup and scoping of hiera data from erb templates
Hey Folks. Reading through the docs and the mailing list only helped confusing me more, so maybe its better to just ask if my approach is correct. Imagine a basic project structure with a module and two classes inside: modules |- my_module |-frontend |-backend I''m using Hiera to manage dynamic values, so lets say I have: --- backend: foo: bar: "boo" baz: 42
2007 Oct 06
4
Passing ERB block to helper
I''m trying to pass an ERB block to a helper, and I''m not able to achieve the results I want. The helper should take the block and incorporate it into some other text & html, before finally outputing it back to the ERB template. Here''s what I want: --helper-- def helper (a, b) yld = yield out = --some function of a, b, and yld-- out end --ERB-- <%
2006 Feb 20
7
Native erb lacks -%>, where is Rails'' erb?
Native ERB in ruby, and eruby, seem to lack the -%> feature for suppressing trailing newlines. Thus erb -n script gives errors. Where is Rails ERB so I can invoke it directly? Thank you Hugh
2012 Nov 21
0
What to use //= require_tree or js,css incude tag in application.erb ?
Hi , We are using reqiure_tree in our application.js and application.css. As per i know require_tree include all js and css in application.js and application.css . We include application file of both .js and .css in our application.erb. Q . We include both .js and .css application file in application.erb . Is including in application.erb, did all .js and .css file are included in
2007 Jul 22
1
html.erb and textmate. Cant get snippets to work.
Hello! I moved to html.erb but the snippets fail to work. eg .rhtml lia(tab) gives me link_to .html.erb lia with a tab after it =) I have tried the comment suggested here: http://ryandaigle.com/articles/2007/2/21/what-s-new-in-edge-rails-rhtml-and-rxml-to-die-a-slow-and-painful-death David Demaree: " 1. Select Bundles > Bundle Editor > Edit Languages... from the menu bar. 2. Find
2006 May 30
1
DOM values in ERB Variable?
I am trying to post the current brower window sizes into the user''s session file with a form_remote_tag call as follows: <%= form_remote_tag :url => url_for(:controller => "welcome", :action => "login", :iheight => "1", :iwidth => "2") %> But how do I get the DOM data for window.innerHeight and window.innerWidth into an
2007 Jan 19
4
Rendering with erb
Hi, I thought it would be fun to try to write a render method that uses erb for rending. I''m not much of a programmer, but I still like to try: module Test require ''erb'' def render(m) ERB.new(IO.read("templates/layout.html")).result(binding) do ERB.new(IO.read("templates/#{m}.html")).result(binding) end end end This