Displaying 20 results from an estimated 20000 matches similar to: "How do you log from within your custom class?"
2006 May 11
5
crating a ajax datagrid
hi,
Im looking to build a live data grid, where you can add delete rows
using dhtml.
and was just wondering if anyone is aware of any plugin''s taht may help
me.
Ive found this example but if anyone is aware of any other plugin''s
please let me know
http://unspace.ca/datagrid/update
thanks
scott
--
Posted via http://www.ruby-forum.com/.
2006 Apr 28
9
Global find and replace in RADRAILS. Can you do it?
It seems as though it cannot be done. Does anyone know how to do it?
Thanks
Chris
--
Posted via http://www.ruby-forum.com/.
2006 Aug 18
2
Search window
Hi, I''m a rails newbie in need for some help. I''d like to replace a
dropdown on a form with a pop-up window where I can search for a record
and then return the selected id for the original form.
Is there anything like this available in rails? Does anyone have a tip?
Thanks,
Gabriel.
--
Posted via http://www.ruby-forum.com/.
2006 Aug 13
3
Logging in Rails
This is a newbie question, I have a class which is not derived from
ActionController or ActiveRecord but I want to use logging, I tried require
but still logging does not work -
This class is located in a file in "model" directory.
------------------------------------
require ''logger''
class Cart
def add_product(product)
logger.info("Searching for product
2006 Jan 06
10
I need debugging tips?
Hi all,
Like most other frameworks, Ruby groups code by Model/View/Controller instead
of by task, and therefore I''m having a hard time debugging a problem from the
Agile Rails book where looping through @items errors out because one or more
items is nil.
I managed to empty the cart by placing session[:cart] = nil in find_cart() in
the store_controller_rb, and the problem continued
2012 Sep 18
4
multiple modules defining same method included into a class
In Ruby, classes are never closed: you can always add methods to an
existing class. This applies to the classes you write as well as the
standard, built-in classes. All you have to do is open up a class
definition for an existing class, and the new contents you specify
will be added to whatever''s there. In the same regard, if module is
used with the name of a pre-existing module that
2005 Dec 29
2
Access rails logger from plain class
How can I "get" the rails logger from a plain class, that is a class
that does not inherit from a rails class?
I have tried using RAILS_DEFAULT_LOGGER (see below) but it''s nil
class MyClass
logger = RAILS_DEFAULT_LOGGER
def myMethod
logger.debug("stuff...")
end
end
--
Posted via http://www.ruby-forum.com/.
2006 May 08
5
Files in LIB folder do not seem to update even in DEV mode!!
Hi
When i change my classes in the LIB folder they are not updating on the
server. My server is in development mode. Any ideas why?
Any help is appreciated
Thanks,
Chris
--
Posted via http://www.ruby-forum.com/.
2008 May 22
2
Story / Redirection to static html within public
With a rails application I''m trying to access the public/ folder from
within a rspec story.
I have a controller which redirects to:
/public/static_html_page.html
I have a story written using webat.
This story uses the above controller and it expects the redirection.
This story always fails as within the story it cannot follow the
redirection (Always gives a 500 error). It does not
2006 May 14
2
Timeout in production mode after 2 min, but not in dev mode?!
One of my actions runs for more than 2 minutes. In development mode it
runs and
completes successfully, but in production mode it quits out with a
timeout error:
"Timeout::Error (execution expired):"
Any ideas how i can stop this? I''m desperate to find a solution.
Is there a setting i can change somewhere?
Any help would be greately appreciated,
Thanks
Chris
--
Posted
2006 May 04
3
@products["car"] is not being recognized in my tests!! help
@products["car"] is not being recognized in my tests:
class ProductsControllerTest < Test::Unit::TestCase
fixtures :products
def test_view_product
post :view_product, :id=>@products["car"].id
assert_template "view_product"
...
end
end
products.yml :
car:
id:1
name:test
Does anyone have any idea why its not working?
Im having to do
2006 May 05
2
can you do global match regular expressions?
I cant figure out how to do global regular expressions in ruby. Im not
even sure if its possible. In the "Programming Ruby" book there is no
mention of it.
Can you do this?
text = "aaa1 bbb2 ccccc3 dddddd4 eee5"
re = /\w+\d{1}/
matches = re.match text
m[0] = "aaa1"
m[1] = nil
m[2] = nil
and so on....
Is there any way to get an array of all the matches??
2006 Aug 06
2
Rails logger: how to access it in a my own class
Hey Guys,
The only way I could find to access the Rails logger object was to
subclass from ApplicationController... can anyone suggest a more
sensible way of doing it?
Soroe.
--
Posted via http://www.ruby-forum.com/.
2006 Apr 04
2
Default logger inside arbitrary classes
Hi,
What''s the best way to get the default logger (the one used during the tests) from inside a class that doesn''t inherit any rails class?
Thanks
Oscar
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jan 11
1
logger in my classes
Hi,
I wrote a class which is not an AR extension, nor a controller.
I''d like to use logger.* methods there too.
My class is in lib/ dir. I include it in environment.rb with the line
require ''lib/localization''
just after the line
require File.join(File.dirname(__FILE__), ''boot'')
I tried many ways to reuse the logger class. The cleaner way seemed to
2006 Jun 07
1
What is class TestController < ActionController::Base
What are the different parts of; class TestController <
ActionController::Base?
I look at the http://api.rubyonrails.org/ and try to understand but I
don''t. Could someone give me a hint?
I get the part of Test being the "folder", def and all that, but I can''t
find an explanation of the basic stuff.
--
Posted via http://www.ruby-forum.com/.
2006 Aug 17
3
How to save output "render :action=>:any_action" to a file?
I need to save the output of my rails app to a file. i.e. instead of
rendering a page when using "render :action=>:any_action" i want the
output to be saved to a file.
Anyone got any ideas?
Thanks
Chris
--
Posted via http://www.ruby-forum.com/.
2006 May 12
1
each_with_index. Can you start at a desired index position?
When using array.each_with_index how do you start at a desired index
position?
I can do it like this, but its not very clean and doesnt seem efficient
:
desired_index_start = 20
array.each_with_index do |value,index|
next if index<desired_index_start
end
Thanks
Chris
--
Posted via http://www.ruby-forum.com/.
2006 Apr 19
2
Is it true that you cannot use bind variables with Oracle?
Is it true that you cannot use bind variables with Oracle?
An answer would be really appreciated,
Thanks,
Chris
--
Posted via http://www.ruby-forum.com/.
2012 Feb 07
6
nested route not receiving :id parameter within controller spec
I''ve got a share method in my controller, and I have the following spec:
describe PostsController do
describe "#share" do
it "doesn''t blow up" do
post :share, :id => @post.id
end
# ... etc
And... It blows up!
Failures:
1) PostsController#share shares
Failure/Error: post :share