search for: _variable

Displaying 2 results from an estimated 2 matches for "_variable".

Did you mean: variable
2012 Jul 26
2
Using the :layout option when calling render @variable
Hey everybody, I wanted to use the :layout option when calling render @variable (where @variable is some ActiveRecord class instance with a corresponding variables/_variable.html.erb partial view), but as far as I know, Rails doesn''t support this. Here''s a quick patch that allows to use the :layout function: In partial_renderer.rb, add the following elsif block: if !block && (layout = @options[:layout]) layout = find_template(...
2006 Jan 23
5
Variable Scoping Problem
I am having some problems with variable scoping. I need to be able to set a variable that is accessable by other methods within the class (or instance) (i.e not global). An example is 2 pages that change a class variable: class AjtestController < ApplicationController def initialize @@variable = "init" end def show @display = @@variable @@variable = "change 1"