Displaying 20 results from an estimated 7000 matches similar to: "Instance variables versus local variables"
2006 Jan 19
1
partials and instance variables for file_column
Hi,
Sebastian Kanthak of the file_column-Plugin wrote once:
"is the photo object inside a local variable or an instance variable
(e.g. photo or @photo)? url_for_file_column only works with instance
variables, like all other active record form helpers. Could this be
the problem?"
So I''m using file_column in a partial, e.g.
<%= render (:partial => "product",
2009 Apr 06
9
setup method in functional tests and instance variables
I have the following in my functional test file.
class UserControllerTest < ActionController::TestCase
fixtures :users
def setup
@controller = UserController.new
@request = ActionController::TestRequest.new
@response = ActionController::TestResponse.new
@invalid_user = user(:invalid_user)
@valid_user = users(:valid_user)
end
def test_login_success
2006 Apr 18
4
how would you take the duplication out of this?
i have these two really similar methods in my addressbook controller.
def edit_company
@company = Company.find(params[:id])
if request.post? and @company.update_attributes(params[:company])
flash[:notice] = ''Company was successfully edited.''
redirect_to :action => ''show'', :id => @company
end
end
def edit_person
2011 May 25
1
warning: toplevel constant SomeController referenced by Admin::SomeController
This issue has been discussed before (http://www.ruby-forum.com/topic/
125392) and after spending a while debugging through this, I still
don''t have a solution. Lets try again?
I have two controllers, SomeController and Admin::SomeController. When
SomeController is loaded first (which happens under spork, found out
by editing ActiveSupport::AbstractController) I get warning: toplevel
2009 Apr 24
4
Undefined method "redirect_to" in before_filter
Code sample:
class SomeController < ApplicationController
before_filter do |c|
add_crumb "Blah", "/blah" #breadcrumbs plugin
redirect_to :controller => "foo", :action => "bar" unless c.send
(:has_package?)
end
# Rest of the controller...
private
def has_package?
# A bunch of logic work to check to make sure
# somebody''s session contains
2004 Nov 29
4
1.0-test53, sig11 when sorting by thread
Hello.
When trying to sort a folder by thread (with pine4.61), I get a sig11.
The mailstore is Maildir, indexes stored in /var/indexes/%u.
The syslog on the server shows this:
Nov 29 11:37:55 olan dovecot: IMAP(kowalski): Corrupted index cache file /var/indexes/kowalski/.INBOX/dovecot.index.cache: record points outside file
Nov 29 11:37:56 olan dovecot: child 14344 (imap) killed with signal 11
2006 Apr 22
3
Creating a select dropdown box with links to methods
What would be the best way to create a form select dropdown box and upon
"submit" have it directly go to a controller method view?
I have something that somewhat works, but I think there is probably a
much easier way to do it. As of now, I have the dropdown list which
when the form is submitted is handed to a controller method which
basically
I have my dropdown box:
<%=
2014 Dec 05
6
[LLVMdev] instruction/intrinsic for segmented adressing
Hi,
would like to use LLVM as backend for a compiler. One of the features I
would like to implement is segment based addressing for position
independent data. For some it may sound strange, for others the opposite.
No need to write complex story. Imagine you have a custom alocator that
manages an area of 1GB of memory. Your application uses a custom allocator
to allocate memory inside this area,
2006 May 03
1
nil.strip error While trying to post xml data over https.
I am trying to subit some xml data over https to access an API. My code
so far seems to generate a very non-helpful error in the guts of the
net/http library. This code produces a NoMethodError for nil.strip"
require ''net/http''
require ''net/https''
require ''uri''
url =
2008 Mar 08
7
ridding away with do_request
I''m heading out of town, but had a quick thought I wanted to share.
Rather then using ambiguous named request helpers in controller specs
like "do_request", I''ve been using more readable helpers like
"post_create".
For example...
describe ProjectController do
def post_create
post :create, ...
end
before do
end
it "creates a new
2017 May 09
3
Generating samples from truncated multivariate Student-t distribution
Dear Members,
I am working with 6-dimensional Student-t distribution with 4 degrees
of freedom truncated to [20; 60]. I have generated 100 000 samples
from truncated multivariate Student-t distribution using rtmvt
function from package ?tmvtnorm?. I have also calculated mean vector
using equation (3) from attached pdf. The problem is, that after
summing all elements in one column of rtmvt result
2007 Nov 23
12
namespaced controllers
Out of curiosity, I''ve seen the following fail:
module Admin
describe MyController
...
end
end
But this works fine:
describe Admin::MyController
..
end
Why?
Scott
2024 Apr 11
4
D-bus integration
Dear OpenSSH developers,
I was looking at the fail2ban project and had an idea that instead of
parsing log files it could be possible to notify interested parties
(like fail2ban) via (for instance) D-bus about a failed login attempt.
Other application could also use this protocol to notify about suspect
behaviors. A central functionality will allow for other (new) projects
to integrate
2010 Mar 24
3
Build warnings
Hi all,
I've recently decided to take a look at Theora for the first time. The 1.1.1 release compiles fine, but the compiler generates a fairly large number of warnings about "suggest parentheses around + or - inside shift". I've had a look at a few of these and sometimes it isn't obvious what is meant to happen. I guess the code is all correct though as I'm sure
2006 Jun 07
7
file_column image versions
does anyone know much about resizing different versions of images with
file_column? i tried it and everything works fine, but my question is
can you do more than just make sizes with a version of image? i''m
working on a photo album and i would like to resize the image to a
medium size, but create a thumbnail as well and crop anything left to
make the thumbnail a perfect square.
--
2004 Oct 21
2
migration to maildir and arrival time
Hello.
I am currently testing dovecot (0.99.10.8, Debian woody from backports),
with the maildir storage.
I have noticed that when I use the mailutil tool from uw-imap
distribution to transfer my IMAP mailboxes from our current server
(uw-imap, mbx format) to the dovecot one, the mails arrival time are
apparently lost. I can see this in Pine, using the Arrival sort: the
mailboxes on the
2006 Apr 27
7
SuperImage plugin
Greetings all,
This is the first release of the SuperImage plugin. The idea is you
upload images to the database, and then pull them out at any size you
want. Combine this with caching and it will stay light and fast.
More info and instructions are here:
http://beautifulpixel.textdriven.com/articles/2006/04/27/superimage-plugin-making-resizeable-uploaded-images-easy
svn:
2007 Jul 31
2
using win32 DLLs in Linux
Hello,
I have a win32 DLL library, which I can't decompile, and can't get it's source
code, but which I'd like to use in my Linux program. I wondered about making
a win32<->Linux interface to use this library, using ready-to-use wine
libraries.
Is it possible, using wine libraries, to have access to functions from this
DLL?
If yes, can you tell me how?
Thank you in
2006 Apr 26
8
script/server lighttpd on Windows
Has anyone been able to get script/server to successfully use lighttpd
on a Windows box? When I try to start the server I get:
PROBLEM: Lighttpd is not available on your system (or not in your path)
So then I add "C:\lighttpd\sbin" to the path for the console session,
and it still fails with the same error.
If anyone has some success with this I sure would like to know. Webrick
2007 Jan 18
2
How to use API from AWS -- help!
I''m building a users web service (direct dispatching) that will (I hope)
allow several other applications to manage the same pool of users. Plus
it will act as a single-sign-on solution for what I''m doing. But I''m
having difficulty accessing the UserAPI. Here''s what I''ve done so far:
$> rails usermanagement
- "usermanagement" is the