similar to: ERB and Builder template engines shouldn''t be so heavily wired in ActionView::Base

Displaying 20 results from an estimated 200 matches similar to: "ERB and Builder template engines shouldn''t be so heavily wired in ActionView::Base"

2012 Sep 14
1
calling method on base intended to simulate initialize on instances?
class A def initialize setup_b setup_c end def b_and_c "#{@b} and #{@c}" end private def setup_b @b = ''b'' end def setup_c @c = ''c'' end def setup_d @d = ''d'' end end a = A.new a.instance_variable_get("@b") # => "b" a.instance_variable_get("@c") # =>
2006 Aug 15
5
ActiveRecord inheritance
Hello, I got the following issue and I do not know how to resolve it: #1. created parent class (AccountExtended) for some my models (lib/classes_lib.rb): class AccountExtended < ActiveRecord::Base def self.findByAccount end end #2. created model Country: require ''lib/classes_lib'' class Country < AccountExtended end #3. and added a test controller what shows
2010 Jan 19
0
best way to set default for an optional local in a partial?
What''s the best way to set the default value of an optional local variable in a partial template? In the past I''ve used <% foo = default_value unless (defined? foo) %> But http://api.rubyonrails.org/classes/ActionView/Base.html says *not* to use (defined? foo) and instead use (local_assigns.has_key? :foo) thus <% foo = default_value unless (local_assigns.has_key?
2009 Jan 20
5
Problem running rake test
I''m using the One-click 1.8.7rc2 Ruby Windows installer, everything has been working fine up till now, when i want to start getting into testing, i got this error, any reason why? C:/Ruby/bin/ruby -Ilib;test "C:/Ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/ lib/rake/rake_test_loader.rb" "test/unit/word_test.rb" C:/Ruby/lib/ruby/1.8/erb.rb:469:in `scan'': You have a
2008 May 08
0
stub sub partials when testing partial with rspec
Hello all I prefer to use many partials. It makes my code more DRY Also I use rspec, and when I have to test partial with sub partials I have a problem. if I stub render, then my partial will not be rendered. If i do not stub render it tries to render sub partial (and i don''t need this) Not very long googling did not bring the answer, so I made very dirty and IMHO dangerous function
2005 Dec 19
1
Preserving fallback with RJS
Hi guys, I really like RJS. I think they''ll replace partials in alot of instances. Unfortunately, because they''re automatically used like .rhtml and .rxml and are hard to specifically specify it makes it messy to preserve fallbacks when using them. For instance, using partials instead of rjs, my create method might look like: def create post = Post.new(params[:post]) ...
2008 May 29
2
Render partial yields "dynamic constant assignment"
I''m getting a syntax error when rendering a partial. This is a simple html partial with one instance variable inside it. Rendering as a "template" instead of as a partial works just fine. The error occurs 3 lines after the last line of HTML code in the partial. There is no line 72! Here is the error: SyntaxError in Building_blocks#preview Showing
2006 Jan 03
3
render :partial stops setting local variables.
I''m not sure what happened, or what change has caused this to happen, but render :partial (or any render for that matter, doesn''t seem to let me set local variables via the local_assigns argument hash. for example <%= render :partial ''edit'', :username => @user.username %> used to allow that username was a local variable in my _edit.rhtml partial
2008 Jun 30
1
Help with form_for
Hello, I had an app running on RoR 1.1, now I''m migrating it to 2.1. In a view I have: <div id="user_management"> <fieldset> <legend>Please log in</legend> <% form_for(:user, :url => sessions_path) do |f| %> <p>Username: <span class="notice"><%= flash[:notice]%></ span></p>
2006 Mar 09
0
Caching problem: expire_page not working
Hi all, I''m new to rails and I''ve run in to a rather insidious bug. In development (with caching turned on in development.rb), my app successfully caches action "index" in controller "view": class ViewController < ApplicationController caches_page :index def index # do the stuff that index does end end I''ve got a sweeper
2007 May 28
1
Rails matcher render_template is wrong when using GetText, looking for flexible solution
I have a problem with a mismatch between RSpec Rails and the actual behavior when using GetText, and would be glad for suggestions how to best solve this. When using GetText a failure is reported for the following simplified specification: describe SamplesController, "when requesting /samples" do it "should render index " do get ''index''
2007 Dec 17
0
[CruiseControl] RubyOnRails build 8425 failed
The build failed. CHANGES ------- Revision 8422 committed by david on 2007-12-16 23:53:45 Add tests for html_escape, and remove an unneeded backslash (closes #10511) [fxn] M /trunk/actionpack/lib/action_view/template_handlers/erb.rb A /trunk/actionpack/test/template/erb_util_test.rb Revision 8423 committed by david on 2007-12-16 23:55:22 Fix doc (closes #10526) M
2008 Oct 31
10
Strange dependency error after going Ruby1.8.6, Rails 2.1.0 -> Ruby1.8.7, Rails 2.1.2
Hi, I''m getting an error I just can''t find any cause for. The error is "A copy of ApplicationHelper has been removed from the module tree but is still active!" and gets thrown in a Template that uses a method defined in my ApplicationHelper. The error occurs only in development mode. The error did not occur before my switch to Ruby 1.8.7 and Rails 2.1.2 minutes ago. I
2009 Apr 04
11
rake aborted! undefined method `empty?' for nil:NilClass
Hi, I''m getting the next errors, would anyone have any suggestions? Thanks. [~/rails/hip]# rake --trace db:migrate RAILS_ENV="production" (in /home/domain/rails/hip) ** Invoke db:migrate (first_time) ** Invoke environment (first_time) ** Execute environment rake aborted! undefined method `empty?'' for nil:NilClass /usr/lib/ruby/1.8/erb.rb:469:in `scan''
2006 May 14
1
send_file, RRDtool, require or session problem
Hi all, I am new to RoR and ruby, but am a very experience PHP developer. Let me give an overview of the problem. I have a model Latency, which contains username, graph_name so the logged in user can see his/her latency graphs. In my ViewController I have a fuction view_latency which pulls the correct latency object and runs latency.overview. latency.overview creates a .png file in /tmp, and
2006 Jan 22
2
Using register_template_handler to serve CSS files (Making ActionView handle .css as .rhtml)
Hi, I wanted to be able to use some Rails code inside CSS files, so I set up a controller (StylesController) to serve CSS files that reside inside the controller''s view folder when the browser requests /stylesheets/:action So in the controller I just define empty actions with the names I want my style sheets in (ie: def cooleffects end - that would respond to
2008 Mar 23
6
Locals do not appear in partial unless collection is explici
Maybe I''m misunderstanding something but it appears as if <%= render :partial => @items, @locals => { :this => ''that'' } %> does not give the local variable this but this one does: <%= render :partial => ''items/item'', :collection => @items, @locals => { :this => ''that'' } %> Shouldn''t they mean
2006 Aug 11
2
Shouldn''t CRUD be CRUDS?
With most models, almost always I find myself writing Search/Find actions. When I view a Listing of a model, I want to look at another record or set of records. How nice it would be if I can do a query-by-example while viewing a Listing, or during Show/Edit/Create. Would be nice if Search becomes another act in the scaffolding magic. This wish has been expressed here before. Since then, has
2007 Apr 11
0
Fwd: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s
---------- Forwarded message ---------- From: noreply at rubyforge.org <noreply at rubyforge.org> Date: 11-Apr-2007 15:07 Subject: [ mocha-Bugs-6416 ] Mock objects shouldn''t define #to_s To: noreply at rubyforge.org Bugs item #6416, was opened at 2006-10-31 15:34 You can respond by visiting: http://rubyforge.org/tracker/?func=detail&atid=7477&aid=6416&group_id=1917
2005 Jul 11
0
Shouldn''t use autocomplete for absolute-positioned elements?
I''d like to tap in to the expertise here on this list. The autocompletion box at raildock.mytechsupport.com is a bit of a hack right now--the drop-down box is quite a ways off from where it should be, and it would be even further off if I hadn''t hacked controls.js to subtract a few pixels from its location on screen. Is there some guidelines for where and how to place a