Displaying 20 results from an estimated 10000 matches similar to: "How does view know about instance vars set in controller?"
2005 Dec 30
1
metaprogramming in controller: accessing instance variables
Hi all,
I''m trying to move a bunch of methods out of a controller into a
library that I can include and call a class method to have it
dynamically add a bunch of methods to the controller.
The goal is to just add to each controller:
include UIEnhancements::SubList
sub_list ''Note'', ''incomplete''
and have the sub_list method create all the methods
2006 Jan 03
1
RequireResourceHelper for JS and CSS
The following was posted on my blog at http://blog.inquirylabs.com.
A friend of mine recently expressed interest in this code snippet, so
I thought I''d send it out to anyone else who''s interested. This
module makes it a lot easier to ''require'' javascript and cascading
stylesheet dependencies inside your views or controllers. By
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
2011 May 04
1
is not allowed as an instance variable name error
Hey all,
I get error like this:
ActionView::TemplateError
(`@content_for_details_view_builder__-626960428'' is not allowed as an
instance variable name) in app/views/shared/_details_view.haml:
searchlogic (2.4.27) lib/searchlogic/rails_helpers.rb:75:in
`fields_for''
searchlogic (2.4.27) lib/searchlogic/rails_helpers.rb:64:in
`form_for''
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around
filter. I have defined expectations on the model classes, and ideally, I
would add a further expectation for the scope. Is this already possible
in some way? How would I go about adding support a scope expectation?
Michael
--
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/
2010 Dec 12
2
CMCI exceptions happened and MCE entry state transition made Xen crashed.
Hi all,
Three days ago, the server reported lots of CMCI exceptions and Xen 3.4.2 printed hundreds of "CMCI: send CMCI to DOM0 through virq" messages to the console . From the console output, Then I can see that Dom0 try to read the MSR_CAP regs by #GP trap in order to log the MCA error.
I am not sure why so many CMCI happened , maybe there were some thing wrong with the hardware.
2010 Dec 12
2
CMCI exceptions happened and MCE entry state transition made Xen crashed.
Hi all,
Three days ago, the server reported lots of CMCI exceptions and Xen 3.4.2 printed hundreds of "CMCI: send CMCI to DOM0 through virq" messages to the console . From the console output, Then I can see that Dom0 try to read the MSR_CAP regs by #GP trap in order to log the MCA error.
I am not sure why so many CMCI happened , maybe there were some thing wrong with the hardware.
2006 Jan 17
2
file_column plugin and instance variables
To make file_column work I have to copy my local variable back to an
instance variables like this:
<% for product in @products
@product = product %>
<div class="catalogentry">
<%= image_tag url_for_file_column(''product'', ''image_url'') %></p>
This is needed because file_column specifically looks for the instance
2007 Apr 12
4
Re: [Xense-devel] [RFC][PATCH][UPDATED] Intel(R) LaGrande Technology support
Hello,
Has any more work been done on this front? The message below is
from Sept. 2006. In particular, the LT/TXT Technology Enabling
Platform (TEP) is now available from MPC Corp. Where can one
obtain an appropriate AC SINIT module (i.e., like
lpg_sinit_20050831_pae.auth.bin below)? I would like to begin
using Xen with TXT support.
Thanks,
-Jon
This patch adds SMP support to the
2006 Jul 11
1
instance vars in layouts
Hello List,
The layouts contain the instance var @content_for_layout; is it possible
that they may also contain the instance vars from a controller similar to
the way a controller''s views do?
cheers,
- trav
--
p [151,40,154,157,166,145,40,162,165,142,171].collect { |ii| eval
''"\\''+ii.to_s+''"'' }.join
-------------- next part --------------
2005 Dec 23
1
Handling file uploads & mixing class and instance vars
Hey Everybody,
This is the only way I''ve been able to get my file
upload to work:
class Item < ActiveRecord::Base
def file=(upload)
@file=upload
end
def after_create
File.open("public/items/#{self.id}.jpg", "w") {
|f| f.write(@file.read) }
end
end
The upload form has "file_field ''item'', ''file'',
2006 May 04
1
Instance or local vars for field helpers in partial template
I''m getting confused.
If I have a view (.rhtml), I can use a field helper like:
<%= text_field :mymodel, :attribute %>
This uses the value from @mymodel.attribute
Now, if I am rendering a template normally (i.e. not partial), I would
expect @mymodel to be a model object defined as an instance variable in
the controller.
However, if I am rendering a partial template, I
2011 Aug 22
4
Does anyone know if I can reconfigure a PERC H700 without rebooting?
Hi all,
I have a server which is really difficult to restart because
of usage requirements
and the fact that it's in a co-lo rack so miles away. I've added a
couple of drives which
I'd like to bring up and add to LVM but the config I know is in the
PERC BIOS and
requires a reboot.
Can the config be changed in the openmanage suite and if so can someone point me
in the right
2008 Mar 14
4
How to know which env vars a software wants
Hello ppl.
Im trying to install an aplication and for some reason ir says.
"Cannot get enviorment variables"
I spoke with the developer and he told me that it is because i dont have microsoft DAC installed.
I installed it and the problem persists.
I need to know how to see which ENV vars the software wants in order to create them.
It is not a wine problem because I get the same error
2013 Nov 05
4
Handling closed clients
We have a service that clients use to upload files. We have a couple of clients that are on slow links and so their upload times out. We get errors in the logs that I''d like to get rid of.
I was hoping that the recent commit 24b9f66dcdda44378b4053645333ce9ce336b413 would help us, but it does not. After digging in a bit, I have some ideas about why and a patch I''d like comments
2005 Mar 09
9
Unit testing + instance variables
After *much* digging and playing around, I finally figured out how to
unit test instance variables that are created by actions. It was
more difficult than I expected. It seems like there should have been
a more straight forward way to do this. Can someone enlighten me? A
simplified and somewhat contrived example of what I am current doing:
Thanks.
Matt
>>
# My Controller of interest
2008 May 07
1
Assigning to the foreign key on a belongs_to association
I''ve encountered what seems like an odd omission in the behaviour of
belongs_to associations: if you assign to the foreign key attribute,
it doesn''t update the associated object (or mark a previously loaded
one as stale) until you explicitly save or reload it.
Let''s say we have a Company model, which belongs_to :city :
>> torchbox =
2009 Apr 22
3
Error on running any controller- Noob question
Hi ,
I am running on Vista with webrick ...
When I generate controllers , models and views I get an error as
under.
C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/
dependencies.rb:105:in `const_missing''
C:/ROR_lpapp042109/app/controllers/afflnetworks_controller.rb:5:in
`index''
I tried reinstalling but kept stumbling on this.
gem -v
1.3.2
rails -v
2.3.2
2013 Mar 07
2
Puppet Dashboard changed reports view error
Hello Puppet Users !
We encounter a problem with the dashboard on this URI : /reports/changed
The /reports works fine with ~130000 reports (up to 3 months and
auto-cleaning with rake reports:prune job)
I make a reports:prune:orphaned, juste in case, but without any success.
The most recent change on the server was the puppetmaster upgrade from
3.0.2 to 3.1.0.
Here is the dashboard error log
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") # =>